fix buffer overrun in some calls to sscanf

Reported-by: Sergei Antonov <saproj@gmail.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
This commit is contained in:
Karel Zak 2012-07-09 22:26:27 +02:00
parent cd903a0eba
commit 657d9adb71
7 changed files with 7 additions and 7 deletions

View file

@ -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 ]",