projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
26a7e2e
)
pstree: fix theoretically unsafe code
author
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 27 Jun 2013 23:59:25 +0000
(
01:59
+0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Thu, 27 Jun 2013 23:59:25 +0000
(
01:59
+0200)
In practice, p->comm is never long enough to trigger the bug, but still.
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
procps/pstree.c
patch
|
blob
|
history
diff --git
a/procps/pstree.c
b/procps/pstree.c
index ea690a9c832f4efba6a846dad8bbf591c989c690..ed1a4128950dbd65bc1015fede1217174512bbb2 100644
(file)
--- a/
procps/pstree.c
+++ b/
procps/pstree.c
@@
-349,7
+349,7
@@
static void dump_by_user(PROC *current, uid_t uid)
static void handle_thread(const char *comm, pid_t pid, pid_t ppid, uid_t uid)
{
char threadname[COMM_DISP_LEN + 1];
- sprintf(threadname, "{%.*s}", (int)sizeof(threadname) -
1
, comm);
+ sprintf(threadname, "{%.*s}", (int)sizeof(threadname) -
3
, comm);
add_proc(threadname, pid, ppid, uid/*, 1*/);
}
#endif