Commit c03b9f6d authored by albert's avatar albert

fix buffer overflow

parent 29cbc635
......@@ -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]);
if (!strcmp("-V", argv[i]) || !strcmp("--version", argv[i]))
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment