[dm-devel] [PATCH 03/12] kpartx(coverity): fix apparent out-of-bounds access

Martin Wilck mwilck at suse.com
Tue Jan 8 22:54:00 UTC 2019


This was a false positive.

Signed-off-by: Martin Wilck <mwilck at suse.com>
---
 kpartx/dasd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kpartx/dasd.c b/kpartx/dasd.c
index fb358ad..61b609a 100644
--- a/kpartx/dasd.c
+++ b/kpartx/dasd.c
@@ -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);
 
-- 
2.19.2




More information about the dm-devel mailing list