summaryrefslogtreecommitdiff
path: root/src/libudev
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-04-05 08:30:49 +0200
committerAnthony G. Basile <blueness@gentoo.org>2015-04-12 11:35:50 -0400
commit39de7639b455e981e9264ffca4291250b4bd4703 (patch)
treed2964b8e21a7f3812af442716f9cbb7d2993e577 /src/libudev
parent9dfdc62113a54e0dd80a6663321a910af8e78992 (diff)
libudev-util: check length before accesing the array
Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
Diffstat (limited to 'src/libudev')
-rw-r--r--src/libudev/libudev-util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index e626aad53e..e5d340eea7 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -227,7 +227,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;