From: Karel Zak Date: Wed, 29 Apr 2009 12:24:45 +0000 (+0200) Subject: fdisk: fix max. ptname X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bb66209012bcc33dd2df316a1c42afe1a869fdc1;p=util-linux fdisk: fix max. ptname Signed-off-by: Karel Zak --- diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c index e3b6857f..ef75d4ce 100644 --- a/fdisk/fdisk.c +++ b/fdisk/fdisk.c @@ -2554,7 +2554,7 @@ try(char *device, int user_specified) { static void tryprocpt(void) { FILE *procpt; - char line[100], ptname[100], devname[120]; + char line[128], ptname[128], devname[256]; int ma, mi; unsigned long long sz; @@ -2565,7 +2565,7 @@ tryprocpt(void) { } while (fgets(line, sizeof(line), procpt)) { - if (sscanf (line, " %d %d %llu %100[^\n ]", + if (sscanf (line, " %d %d %llu %128[^\n ]", &ma, &mi, &sz, ptname) != 4) continue; snprintf(devname, sizeof(devname), "/dev/%s", ptname);