forked from pool/schily
Jan Engelhardt
78c564d20c
- fix_junk_in_partition.patch: Initialize memory that created the partition table instead of writing random bytes to it (bsc#1178692) OBS-URL: https://build.opensuse.org/request/show/849718 OBS-URL: https://build.opensuse.org/package/show/utilities/schily?expand=0&rev=121
20 lines
758 B
Diff
20 lines
758 B
Diff
For testing, you can reproduce partition with,
|
|
|
|
# valgrind --malloc-fill=0xba --track-origins=yes /usr/bin/mkisofs -o test.iso -chrp-boot -part <some_small_directory>
|
|
# fdisk -l test
|
|
|
|
|
|
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) ;}
|
|
|