From: Florian Zumbiehl Date: Tue, 8 Sep 2009 19:42:21 +0000 (+0200) Subject: util_run_program(): fix possible buffer overflow #2 X-Git-Tag: 174~781 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=04d4a6f85863552eaedc61cfeef5681776c8bb38;p=systemd util_run_program(): fix possible buffer overflow #2 I'm not sure how likely it is for UTIL_PATH_SIZE to have an odd value (maybe it has right now? :-), but I guess making this universally correct doesn't hurt ... --- diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c index fb64c132..e0670dba 100644 --- a/libudev/libudev-util-private.c +++ b/libudev/libudev-util-private.c @@ -251,7 +251,7 @@ int util_run_program(struct udev *udev, const char *command, char **envp, pid_t pid; char arg[UTIL_PATH_SIZE]; char program[UTIL_PATH_SIZE]; - char *argv[(sizeof(arg) / 2) + 1]; + char *argv[((sizeof(arg) + 1) / 2) + 1]; int devnull; int i; int err = 0;