]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
Fix buffer sizing issue for large pagesize systems, affecting mkfs auto-device-type...
authorNathan Scott <nathans@sgi.com>
Fri, 4 Aug 2006 13:47:52 +0000 (13:47 +0000)
committerNathan Scott <nathans@sgi.com>
Fri, 4 Aug 2006 13:47:52 +0000 (13:47 +0000)
Merge of master-melb:xfs-cmds:26662a by kenmcd.

doc/CHANGES
libdisk/fstype.c

index 0fb89a412c1677cebfc364dde67700e2a7c1ce09..dd8dd725d1ccb71d8b18dce668e22714467d40e2 100644 (file)
@@ -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).
index 225e072f248c42ff50d355310eec83c397831c81..0470b750613531ba80896abbc4354eb5bb00ad98 100644 (file)
@@ -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)