mirror of
https://git.openafs.org/openafs.git
synced 2025-02-01 14:07:39 +00:00
salvage: Zero corrupted header
In the salvager, if we read in a corrupt header (either we get a short read or the magic is mismatched), make sure we zero out the contents, so we don't read garbage further on. Change-Id: Ifb4b9fc1b25d5eab470f0950a1d3bb240f75b0d3 Reviewed-on: http://gerrit.openafs.org/2527 Reviewed-by: Derrick Brashear <shadow@dementia.org> Tested-by: Derrick Brashear <shadow@dementia.org>
This commit is contained in:
parent
9da5e4700b
commit
1c002a5b5d
@ -2377,6 +2377,9 @@ SalvageHeader(register struct stuff *sp, struct InodeSummary *isp, int check,
|
|||||||
Log("Part of the header (%s) is corrupted; recreating\n",
|
Log("Part of the header (%s) is corrupted; recreating\n",
|
||||||
sp->description);
|
sp->description);
|
||||||
recreate = 1;
|
recreate = 1;
|
||||||
|
/* header can be garbage; make sure we don't read garbage data from
|
||||||
|
* it below */
|
||||||
|
memset(&header, 0, sizeof(header));
|
||||||
}
|
}
|
||||||
if (sp->inodeType == VI_VOLINFO
|
if (sp->inodeType == VI_VOLINFO
|
||||||
&& header.volumeInfo.destroyMe == DESTROY_ME) {
|
&& header.volumeInfo.destroyMe == DESTROY_ME) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user