]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fincore: fix multiplication overflow
authorRuediger Meier <ruediger.meier@ga-group.nl>
Thu, 6 Apr 2017 07:56:03 +0000 (09:56 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 6 Apr 2017 10:30:09 +0000 (12:30 +0200)
This failed on ppc64 with page size 64k.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
misc-utils/fincore.c

index b867c2d06671009362563b65a828d35705fc9c97..425f1bf42535ad6113613f54e2e9bd038cefaeb1 100644 (file)
@@ -188,7 +188,7 @@ static int fincore_fd (struct fincore_control *ctl,
                       off_t file_size,
                       off_t *count_incore)
 {
-       size_t window_size = N_PAGES_IN_WINDOW * ctl->pagesize;
+       size_t window_size = (size_t)N_PAGES_IN_WINDOW * ctl->pagesize;
        off_t  file_offset;
        void  *window = NULL;
        int rc = 0;