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
d31ff14e
Commit
d31ff14e
authored
25 years ago
by
Tatsuo Ishii
Browse files
Options
Downloads
Patches
Plain Diff
Fix memory overrun while setting ps status
parent
18c30002
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/backend/utils/init/globals.c
+8
-1
8 additions, 1 deletion
src/backend/utils/init/globals.c
src/include/utils/ps_status.h
+7
-8
7 additions, 8 deletions
src/include/utils/ps_status.h
with
15 additions
and
9 deletions
src/backend/utils/init/globals.c
+
8
−
1
View file @
d31ff14e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.3
8
1999/1
0/08 04:28:48 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.3
9
1999/1
2/10 10:29:01 ishii
Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
...
...
@@ -88,6 +88,13 @@ char *IndexedCatalogNames[] = {
};
/*
* ps status buffer
*/
#ifndef linux
char
Ps_status_buffer
[
1024
];
#endif
/* ----------------
* we just do a linear search now so there's no requirement that the list
* be ordered. The list is so small it shouldn't make much difference.
...
...
This diff is collapsed.
Click to expand it.
src/include/utils/ps_status.h
+
7
−
8
View file @
d31ff14e
...
...
@@ -48,10 +48,9 @@ char *ps_status_buffer = NULL
#else
/* !linux */
extern
const
char
**
p
s_status
;
extern
char
P
s_status
_buffer
[]
;
#define PS_DEFINE_BUFFER \
const char **ps_status = NULL
#define PS_DEFINE_BUFFER
#define PS_INIT_STATUS(argc, argv, execname, username, hostname, dbname) \
{ \
...
...
@@ -61,18 +60,18 @@ const char **ps_status = NULL
argv[1] = hostname; \
argv[2] = username; \
argv[3] = dbname; \
ps_status = (const char **)&argv[4]
; \
for (i =
4
; i < argc; i++) \
argv[4] = Ps_status_buffer
; \
for (i =
5
; i < argc; i++) \
argv[i] = "";
/* blank them */
\
}
#define PS_CLEAR_STATUS() \
{
if (p
s_status
) *ps_status = ""
; }
{
P
s_status
_buffer[0] = '\0'
; }
#define PS_SET_STATUS(status) \
{
if (ps_status) *ps_status =
(status); }
{
strcpy(Ps_status_buffer,
(status)
)
; }
#define PS_STATUS (
p
s_status
? *ps_status : ""
)
#define PS_STATUS (
P
s_status
_buffer
)
#endif
#ifdef NO_PS_STATUS
...
...
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