SHA256
1
0
forked from pool/lvm2
lvm2/fix_pointer_arithmetic.diff

12 lines
480 B
Diff

--- lib/device/device.c
+++ lib/device/device.c 2007/01/08 15:11:19
@@ -72,7 +72,7 @@
/* Check for msdos partition table */
part_magic = buf + PART_MAGIC_OFFSET/sizeof(buf[0]);
if ((*part_magic == xlate16(PART_MAGIC))) {
- part = (struct partition *) (buf + PART_OFFSET);
+ part = (struct partition *) (((unsigned char*)buf) + PART_OFFSET);
for (p = 0; p < 4; p++, part++) {
/* Table is invalid if boot indicator not 0 or 0x80 */
if ((part->boot_ind & 0x7f)) {