From: Karel Zak Date: Wed, 29 Apr 2009 12:17:39 +0000 (+0200) Subject: blockdev: fix possible buffer overflow X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=18c3e243414ebcaac3603a86e9ac55c232715fd8;p=util-linux blockdev: fix possible buffer overflow Signed-off-by: Karel Zak --- diff --git a/disk-utils/blockdev.c b/disk-utils/blockdev.c index 3f9e81d2..7d1f8086 100644 --- a/disk-utils/blockdev.c +++ b/disk-utils/blockdev.c @@ -313,7 +313,7 @@ report_all_devices(void) { } while (fgets(line, sizeof(line), procpt)) { - if (sscanf (line, " %d %d %d %[^\n ]", + if (sscanf (line, " %d %d %d %200[^\n ]", &ma, &mi, &sz, ptname) != 4) continue;