summaryrefslogtreecommitdiff
path: root/libudev
diff options
context:
space:
mode:
authorFlorian Zumbiehl <florz@florz.de>2009-09-08 21:42:21 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-09-08 21:42:21 +0200
commit04d4a6f85863552eaedc61cfeef5681776c8bb38 (patch)
treebb0109cc5447c55c3dcfcfa918db433135557df9 /libudev
parent1da6c797fdbb94372c1a809acf1a0ca159b2d7b1 (diff)
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 ...
Diffstat (limited to 'libudev')
-rw-r--r--libudev/libudev-util-private.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libudev/libudev-util-private.c b/libudev/libudev-util-private.c
index fb64c13229..e0670dbae5 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;