qubes-restore: ensure we don't read outside the buffer

Marek says the 20 offset was there for a previous Xen
save file format, and is no longer needed.
This commit is contained in:
Vincent Penquerc'h 2013-12-30 09:18:01 -05:00 committed by Marek Marczykowski-Górecki
parent ed24d8bc75
commit f3850b7a71

View File

@ -218,7 +218,7 @@ char *get_vmname_from_savefile(int fd)
exit(1);
}
buf[buflen] = 0;
name = strstr(buf + 20, NAME_PATTERN);
name = strstr(buf, NAME_PATTERN);
if (!name) {
fprintf(stderr,
"cannot find 'volatile.img' in savefile\n");