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
d31ff14e
Commit
d31ff14e
authored
Dec 10, 1999
by
Tatsuo Ishii
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix memory overrun while setting ps status
parent
18c30002
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
9 deletions
+15
-9
src/backend/utils/init/globals.c
src/backend/utils/init/globals.c
+8
-1
src/include/utils/ps_status.h
src/include/utils/ps_status.h
+7
-8
No files found.
src/backend/utils/init/globals.c
View file @
d31ff14e
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
*
*
*
*
* IDENTIFICATION
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.3
8 1999/10/08 04:28:48 momjian
Exp $
* $Header: /cvsroot/pgsql/src/backend/utils/init/globals.c,v 1.3
9 1999/12/10 10:29:01 ishii
Exp $
*
*
* NOTES
* NOTES
* Globals used all over the place should be declared here and not
* Globals used all over the place should be declared here and not
...
@@ -88,6 +88,13 @@ char *IndexedCatalogNames[] = {
...
@@ -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
* 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.
* be ordered. The list is so small it shouldn't make much difference.
...
...
src/include/utils/ps_status.h
View file @
d31ff14e
...
@@ -48,10 +48,9 @@ char *ps_status_buffer = NULL
...
@@ -48,10 +48,9 @@ char *ps_status_buffer = NULL
#else
/* !linux */
#else
/* !linux */
extern
c
onst
char
**
ps_status
;
extern
c
har
Ps_status_buffer
[]
;
#define PS_DEFINE_BUFFER \
#define PS_DEFINE_BUFFER
const char **ps_status = NULL
#define PS_INIT_STATUS(argc, argv, execname, username, hostname, dbname) \
#define PS_INIT_STATUS(argc, argv, execname, username, hostname, dbname) \
{ \
{ \
...
@@ -61,18 +60,18 @@ const char **ps_status = NULL
...
@@ -61,18 +60,18 @@ const char **ps_status = NULL
argv[1] = hostname; \
argv[1] = hostname; \
argv[2] = username; \
argv[2] = username; \
argv[3] = dbname; \
argv[3] = dbname; \
ps_status = (const char **)&argv[4]
; \
argv[4] = Ps_status_buffer
; \
for (i =
4
; i < argc; i++) \
for (i =
5
; i < argc; i++) \
argv[i] = "";
/* blank them */
\
argv[i] = "";
/* blank them */
\
}
}
#define PS_CLEAR_STATUS() \
#define PS_CLEAR_STATUS() \
{
if (ps_status) *ps_status = ""
; }
{
Ps_status_buffer[0] = '\0'
; }
#define PS_SET_STATUS(status) \
#define PS_SET_STATUS(status) \
{
if (ps_status) *ps_status = (status
); }
{
strcpy(Ps_status_buffer, (status)
); }
#define PS_STATUS (
ps_status ? *ps_status : ""
)
#define PS_STATUS (
Ps_status_buffer
)
#endif
#endif
#ifdef NO_PS_STATUS
#ifdef NO_PS_STATUS
...
...
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