From 04d4a6f85863552eaedc61cfeef5681776c8bb38 Mon Sep 17 00:00:00 2001 From: Florian Zumbiehl Date: Tue, 8 Sep 2009 21:42:21 +0200 Subject: [PATCH] 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 ... --- libudev/libudev-util-private.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.39.5