kpartx(coverity): fix apparent out-of-bounds access
authorMartin Wilck <mwilck@suse.com>
Tue, 8 Jan 2019 22:54:00 +0000 (23:54 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Sat, 19 Jan 2019 10:41:36 +0000 (11:41 +0100)
This was a false positive.

Signed-off-by: Martin Wilck <mwilck@suse.com>
kpartx/dasd.c

index fb358ad..61b609a 100644 (file)
@@ -190,7 +190,7 @@ read_dasd_pt(int fd, struct slice all, struct slice *sp, int ns)
                memcpy (&vlabel, data, sizeof(vlabel));
        else {
                bzero(&vlabel,4);
-               memcpy (&vlabel.vollbl, data, sizeof(vlabel) - 4);
+               memcpy ((char *)&vlabel + 4, data, sizeof(vlabel) - 4);
        }
        vtoc_ebcdic_dec(vlabel.vollbl, type, 4);