summaryrefslogtreecommitdiffstats
path: root/lib/loopdev.c
diff options
context:
space:
mode:
authorKarel Zak2012-07-09 22:26:27 +0200
committerKarel Zak2012-07-09 22:26:27 +0200
commit657d9adb71ed50275b1ed2a0d4e966032db5ba97 (patch)
tree071fa200585354a29f51d1e0cf51baa5b4b9ba4e /lib/loopdev.c
parentutmpdump: white space fix (diff)
downloadkernel-qcow2-util-linux-657d9adb71ed50275b1ed2a0d4e966032db5ba97.tar.gz
kernel-qcow2-util-linux-657d9adb71ed50275b1ed2a0d4e966032db5ba97.tar.xz
kernel-qcow2-util-linux-657d9adb71ed50275b1ed2a0d4e966032db5ba97.zip
fix buffer overrun in some calls to sscanf
Reported-by: Sergei Antonov <saproj@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/loopdev.c')
-rw-r--r--lib/loopdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/loopdev.c b/lib/loopdev.c
index b759f0c28..b644ae50c 100644
--- a/lib/loopdev.c
+++ b/lib/loopdev.c
@@ -478,7 +478,7 @@ static int loopcxt_next_from_proc(struct loopdev_cxt *lc)
while (fgets(buf, sizeof(buf), iter->proc)) {
unsigned int m;
- char name[128];
+ char name[128 + 1];
if (sscanf(buf, " %u %*s %*s %128[^\n ]",