From: Thomas Hindoe Paaboel Andersen Date: Sun, 5 Apr 2015 06:30:49 +0000 (+0200) Subject: libudev-util: check length before accesing the array X-Git-Tag: v220~590 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4835f5639a0ec0b8df0b57abdbc2fb07dbe1507c;p=thirdparty%2Fsystemd.git libudev-util: check length before accesing the array --- diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c index 0f8f634ca3f..f4656277c61 100644 --- a/src/libudev/libudev-util.c +++ b/src/libudev/libudev-util.c @@ -216,7 +216,7 @@ int util_replace_whitespace(const char *str, char *to, size_t len) /* strip leading whitespace */ i = 0; - while (isspace(str[i]) && (i < len)) + while ((i < len) && isspace(str[i])) i++; j = 0;