summaryrefslogtreecommitdiffstats
path: root/fdisk/fdisk.c
diff options
context:
space:
mode:
authorKarel Zak2009-04-29 14:24:45 +0200
committerKarel Zak2009-04-29 14:24:45 +0200
commitbb66209012bcc33dd2df316a1c42afe1a869fdc1 (patch)
tree5b4c01ece0b6465c2e74d483643af3b87129dfce /fdisk/fdisk.c
parentblockdev: fix possible buffer overflow (diff)
downloadkernel-qcow2-util-linux-bb66209012bcc33dd2df316a1c42afe1a869fdc1.tar.gz
kernel-qcow2-util-linux-bb66209012bcc33dd2df316a1c42afe1a869fdc1.tar.xz
kernel-qcow2-util-linux-bb66209012bcc33dd2df316a1c42afe1a869fdc1.zip
fdisk: fix max. ptname
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fdisk/fdisk.c')
-rw-r--r--fdisk/fdisk.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/fdisk/fdisk.c b/fdisk/fdisk.c
index e3b6857f8..ef75d4ce4 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);