Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emacs
emacs
Commits
2fdc7d00
Commit
2fdc7d00
authored
Dec 05, 2008
by
Eli Zaretskii
Browse files
(procfs_system_process_attributes): Don't use cmd, cmdsize, and q without
initializing them first.
parent
248c026b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
3 deletions
+13
-3
src/ChangeLog
src/ChangeLog
+5
-0
src/process.c
src/process.c
+8
-3
No files found.
src/ChangeLog
View file @
2fdc7d00
2008-12-05 Eli Zaretskii <eliz@gnu.org>
* process.c (procfs_system_process_attributes): Don't use cmd,
cmdsize, and q without initializing them first.
2008-12-04 Jason Rumney <jasonr@gnu.org>
* w32font.c (w32font_draw): Initialize orig_clip before getting
...
...
src/process.c
View file @
2fdc7d00
...
...
@@ -7246,9 +7246,9 @@ procfs_system_process_attributes (pid)
char procbuf[1025], *p, *q;
int fd;
ssize_t nread;
const char *cmd;
const char *cmd
= NULL
;
char *cmdline = NULL;
size_t cmdsize, cmdline_size;
size_t cmdsize
= 0
, cmdline_size;
unsigned char c;
int proc_id, ppid, uid, gid, pgrp, sess, tty, tpgid, thcount;
unsigned long long utime, stime, cutime, cstime, start;
...
...
@@ -7300,7 +7300,6 @@ procfs_system_process_attributes (pid)
procbuf[nread] = '\0';
p = procbuf;
cmd = NULL;
p = strchr (p, '(');
if (p != NULL)
{
...
...
@@ -7312,6 +7311,8 @@ procfs_system_process_attributes (pid)
cmdsize = q - cmd;
}
}
else
q = NULL;
if (cmd == NULL)
{
cmd = "???";
...
...
@@ -7452,6 +7453,10 @@ procfs_system_process_attributes (pid)
}
else
{
if (!cmd)
cmd = "???";
if (!cmdsize)
cmdsize = strlen (cmd);
cmdline_size = cmdsize + 2;
cmdline = xmalloc (cmdline_size + 1);
strcpy (cmdline, "[");
...
...
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