Fix potential bufferoverflow in pwdx

Fix potential bufferoverflow in pwdx
 Novell bugzilla entry 78074

Signed-off-by: Werner Fink <werner@suse.de>
This commit is contained in:
Werner Fink 2010-12-20 12:46:37 +01:00 committed by Jan Görig
parent 94866c88bf
commit 9564bfc6f0

1
pwdx.c
View File

@ -60,6 +60,7 @@ int main(int argc, char* argv[])
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]))