From: Nathan Scott Date: Fri, 4 Aug 2006 13:47:52 +0000 (+0000) Subject: Fix buffer sizing issue for large pagesize systems, affecting mkfs auto-device-type... X-Git-Tag: v2.9.0~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=955b7c771a3a045b81a815cfc786fbed297b2ee2;p=thirdparty%2Fxfsprogs-dev.git Fix buffer sizing issue for large pagesize systems, affecting mkfs auto-device-type-detection heuristics. Merge of master-melb:xfs-cmds:26662a by kenmcd. --- diff --git a/doc/CHANGES b/doc/CHANGES index 0fb89a412..dd8dd725d 100644 --- a/doc/CHANGES +++ b/doc/CHANGES @@ -1,3 +1,7 @@ +[cvs] + - Fix buffer sizing issue for large pagesize systems, + affecting mkfs auto-device-type-detection heuristics. + xfsprogs-2.8.9 (18 July 2006) - Fix rpm issue with install targets as uid/gid zero (we now using symbolic names rather than the numeric versions). diff --git a/libdisk/fstype.c b/libdisk/fstype.c index 225e072f2..0470b7506 100644 --- a/libdisk/fstype.c +++ b/libdisk/fstype.c @@ -383,10 +383,13 @@ fstype(const char *device) { if (!type) { /* perhaps the user tries to mount the swap space - on a new disk; warn her before she does mke2fs on it */ + on a new disk; warn her before she does mkfs on it */ int pagesize = getpagesize(); int rd; - char buf[32768]; + char buf[128 * 1024]; /* 64k is current max pagesize */ + + if (pagesize > sizeof(buf)) + abort(); rd = pagesize; if (rd < 8192)