summaryrefslogtreecommitdiff
path: root/pwdx.c
diff options
context:
space:
mode:
authoralbert <>2005-10-30 23:52:35 +0000
committeralbert <>2005-10-30 23:52:35 +0000
commitc03b9f6deb31788552ea5f50e4131c7d959524d5 (patch)
tree282f354d854946d653ab8be9795dda7bd4fd56d5 /pwdx.c
parent29cbc635618d72b0463cd5a3badaf3eaa7c94533 (diff)
downloadprocps-ng-c03b9f6deb31788552ea5f50e4131c7d959524d5.tar.gz
fix buffer overflow
Diffstat (limited to 'pwdx.c')
-rw-r--r--pwdx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pwdx.c b/pwdx.c
index ba8b16d..c1af147 100644
--- a/pwdx.c
+++ b/pwdx.c
@@ -59,7 +59,7 @@ int main(int argc, char* argv[])
for (i = 1; i < argc; i++) {
if (regexec(&re, argv[i], 0, NULL, 0) != 0) {
- sprintf(buf, "pwdx: invalid process id: %s\n", argv[i]); // FIXME (overflow)
+ snprintf(buf, sizeof buf, "pwdx: invalid process id: %s\n", argv[i]);
die(buf);
}
if (!strcmp("-V", argv[i]) || !strcmp("--version", argv[i]))