Fix issues found by Coverity scan.

- possible overflow of data offset calculation in wipe and
- dereferencing of pointer in a keyring error path.
This commit is contained in:
Milan Broz
2018-10-14 21:47:11 +02:00
parent 202aeece3c
commit 27eaf46c8a
2 changed files with 3 additions and 2 deletions

View File

@@ -1220,7 +1220,7 @@ int LUKS_wipe_header_areas(struct luks_phdr *hdr,
/* Wipe complete header, keyslots and padding aread with zeroes. */
offset = 0;
length = hdr->payloadOffset * SECTOR_SIZE;
length = (uint64_t)hdr->payloadOffset * SECTOR_SIZE;
wipe_block = 1024 * 1024;
/* On detached header or bogus header, wipe at least the first 4k */