vmdk: Fix vmdk_parse_extents
An extra 'p++' after while loop when *p == '\n' will move p to unknown data position, risking parsing junk data or memory access violation. Cc: qemu-stable@nongnu.org Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
This commit is contained in:
parent
b681072d20
commit
899f1ae219
|
@ -772,10 +772,13 @@ static int vmdk_parse_extents(const char *desc, BlockDriverState *bs,
|
||||||
}
|
}
|
||||||
next_line:
|
next_line:
|
||||||
/* move to next line */
|
/* move to next line */
|
||||||
while (*p && *p != '\n') {
|
while (*p) {
|
||||||
|
if (*p == '\n') {
|
||||||
|
p++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
p++;
|
p++;
|
||||||
}
|
}
|
||||||
p++;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue