From c03b9f6deb31788552ea5f50e4131c7d959524d5 Mon Sep 17 00:00:00 2001 From: albert <> Date: Sun, 30 Oct 2005 23:52:35 +0000 Subject: [PATCH] fix buffer overflow --- pwdx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pwdx.c b/pwdx.c index ba8b16d2..c1af1478 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]))