Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
465ed565
Commit
465ed565
authored
Feb 06, 2003
by
Tom Lane
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix core dump when pltcl_elog is called with wrong number of parameters,
per report from Ian Harding.
parent
e24977f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
src/pl/tcl/pltcl.c
src/pl/tcl/pltcl.c
+15
-15
No files found.
src/pl/tcl/pltcl.c
View file @
465ed565
...
...
@@ -31,7 +31,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.6
8 2002/12/30 22:10:54
tgl Exp $
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.6
9 2003/02/06 17:02:11
tgl Exp $
*
**********************************************************************/
...
...
@@ -1255,7 +1255,7 @@ static int
pltcl_elog
(
ClientData
cdata
,
Tcl_Interp
*
interp
,
int
argc
,
CONST84
char
*
argv
[])
{
int
level
;
volatile
int
level
;
sigjmp_buf
save_restart
;
/************************************************************
...
...
@@ -1264,18 +1264,6 @@ pltcl_elog(ClientData cdata, Tcl_Interp *interp,
if
(
pltcl_restart_in_progress
)
return
TCL_ERROR
;
/************************************************************
* Catch the restart longjmp and begin a controlled
* return though all interpreter levels if it happens
************************************************************/
memcpy
(
&
save_restart
,
&
Warn_restart
,
sizeof
(
save_restart
));
if
(
sigsetjmp
(
Warn_restart
,
1
)
!=
0
)
{
memcpy
(
&
Warn_restart
,
&
save_restart
,
sizeof
(
Warn_restart
));
pltcl_restart_in_progress
=
1
;
return
TCL_ERROR
;
}
if
(
argc
!=
3
)
{
Tcl_SetResult
(
interp
,
"syntax error - 'elog level msg'"
,
...
...
@@ -1301,17 +1289,29 @@ pltcl_elog(ClientData cdata, Tcl_Interp *interp,
{
Tcl_AppendResult
(
interp
,
"Unknown elog level '"
,
argv
[
1
],
"'"
,
NULL
);
return
TCL_ERROR
;
}
/************************************************************
* Catch the longjmp from elog() and begin a controlled
* return though all interpreter levels if it happens
************************************************************/
memcpy
(
&
save_restart
,
&
Warn_restart
,
sizeof
(
save_restart
));
if
(
sigsetjmp
(
Warn_restart
,
1
)
!=
0
)
{
memcpy
(
&
Warn_restart
,
&
save_restart
,
sizeof
(
Warn_restart
));
pltcl_restart_in_progress
=
1
;
return
TCL_ERROR
;
}
/************************************************************
* Call elog(), restore the original restart address
* and return to the caller (if no
t catched
)
* and return to the caller (if no
longjmp
)
************************************************************/
UTF_BEGIN
;
elog
(
level
,
"%s"
,
UTF_U2E
(
argv
[
2
]));
UTF_END
;
memcpy
(
&
Warn_restart
,
&
save_restart
,
sizeof
(
Warn_restart
));
return
TCL_OK
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment