]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/blobdiff - libxfs/init.c
Fix a large sector size issue in xfs_repair.
[thirdparty/xfsprogs-dev.git] / libxfs / init.c
index e5ffd11a053711fc51aa5e4237d956818f951a50..8ac8ad670996a250f09ec72d35afc4c5ca9db3bd 100644 (file)
@@ -660,7 +660,7 @@ libxfs_mount(
 
        /* Allocate and initialize the per-ag data */
        size = sbp->sb_agcount * sizeof(xfs_perag_t);
-       if ((mp->m_perag = calloc(size, 1)) == NULL) {
+       if (size && (mp->m_perag = calloc(size, 1)) == NULL) {
                fprintf(stderr, _("%s: failed to alloc %ld bytes: %s\n"),
                        progname, (long)size, strerror(errno));
                exit(1);