Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
postgres-lambda-diff
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jakob Huber
postgres-lambda-diff
Commits
465ed565
Commit
465ed565
authored
22 years ago
by
Tom Lane
Browse files
Options
Downloads
Patches
Plain Diff
Fix core dump when pltcl_elog is called with wrong number of parameters,
per report from Ian Harding.
parent
e24977f3
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/pl/tcl/pltcl.c
+15
-15
15 additions, 15 deletions
src/pl/tcl/pltcl.c
with
15 additions
and
15 deletions
src/pl/tcl/pltcl.c
+
15
−
15
View file @
465ed565
...
...
@@ -31,7 +31,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.6
8
200
2/12/30 22:10:54
tgl Exp $
* $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.6
9
200
3/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
;
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment