2020-11-21 01:33:55 +01:00
|
|
|
From: Adam Majer <amajer@suse.com>
|
|
|
|
Date: 2020-11-20 17:31+0000
|
2020-11-21 01:32:13 +01:00
|
|
|
|
2020-11-21 01:33:55 +01:00
|
|
|
There is some uninitialized memory. For testing, you can reproduce
|
|
|
|
partition with
|
2020-11-21 01:32:13 +01:00
|
|
|
|
2020-11-21 01:33:55 +01:00
|
|
|
mkdir empty
|
|
|
|
valgrind --malloc-fill=0xba --track-origins=yes \
|
|
|
|
mkisofs -o test.iso -chrp-boot -part empty
|
|
|
|
hexdump -C test.iso
|
2020-11-21 01:32:13 +01:00
|
|
|
|
|
|
|
Index: cdrtools-3.02/libhfs_iso/internal.h
|
|
|
|
===================================================================
|
|
|
|
--- cdrtools-3.02.orig/libhfs_iso/internal.h
|
|
|
|
+++ cdrtools-3.02/libhfs_iso/internal.h
|
|
|
|
@@ -26,7 +26,7 @@
|
|
|
|
# define ERROR(code, str) (hfs_error = (str), errno = (code))
|
|
|
|
|
|
|
|
# define SIZE(type, n) ((size_t) (sizeof(type) * (n)))
|
|
|
|
-# define ALLOC(type, n) ((type *) malloc(SIZE(type, n)))
|
|
|
|
+# define ALLOC(type, n) ((type *) calloc(sizeof(type), n))
|
|
|
|
# define ALLOCX(type, n) ((n) ? ALLOC(type, n) : (type *) 0)
|
|
|
|
# define FREE(ptr) {if (ptr) free((void *) ptr) ;}
|
|
|
|
|