procps/pwdx-bufferoverflow.diff

11 lines
434 B
Diff

--- procps-3.2.7/pwdx.c
+++ procps-3.2.7/pwdx.c 2006-06-26 16:38:12.000000000 +0200
@@ -60,6 +60,7 @@
for (i = 1; i < argc; i++) {
if (regexec(&re, argv[i], 0, NULL, 0) != 0) {
snprintf(buf, sizeof buf, "pwdx: invalid process id: %s\n", argv[i]);
+ buf[sizeof(buf)-1] = '\0';
die(buf);
}
if (!strcmp("-V", argv[i]) || !strcmp("--version", argv[i]))