summaryrefslogtreecommitdiffstats
path: root/libblkid
diff options
context:
space:
mode:
authorSami Kerola2012-02-07 22:31:03 +0100
committerKarel Zak2012-02-08 14:08:49 +0100
commit358ef9c0d17d21d450067aceaffd90635e8845b8 (patch)
treefc7808dea567c19804b52fb980082e5ece558af5 /libblkid
parentlibblkid: allow return value to indicate error [cppcheck] (diff)
downloadkernel-qcow2-util-linux-358ef9c0d17d21d450067aceaffd90635e8845b8.tar.gz
kernel-qcow2-util-linux-358ef9c0d17d21d450067aceaffd90635e8845b8.tar.xz
kernel-qcow2-util-linux-358ef9c0d17d21d450067aceaffd90635e8845b8.zip
libblkid: verify arroy bound before reference [cppcheck]
[libblkid/src/read.c:428]: (style) Array index end is used before limits check Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'libblkid')
-rw-r--r--libblkid/src/read.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libblkid/src/read.c b/libblkid/src/read.c
index b284ff004..60d13db0c 100644
--- a/libblkid/src/read.c
+++ b/libblkid/src/read.c
@@ -425,7 +425,7 @@ void blkid_read_cache(blkid_cache cache)
continue;
end = strlen(buf) - 1;
/* Continue reading next line if it ends with a backslash */
- while (buf[end] == '\\' && end < sizeof(buf) - 2 &&
+ while (end < (sizeof(buf) - 2) && buf[end] == '\\' &&
fgets(buf + end, sizeof(buf) - end, file)) {
end = strlen(buf) - 1;
lineno++;