mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-05 16:00:05 +01:00
bitlk: fix possible leak of description
If metdata contains more than one description fields, use just the first one. Fixes OSS-fuzz bug 54682.
This commit is contained in:
@@ -701,7 +701,7 @@ int BITLK_read_sb(struct crypt_device *cd, struct bitlk_metadata *params)
|
||||
params->volume_header_offset = le64_to_cpu(entry_header.offset);
|
||||
params->volume_header_size = le64_to_cpu(entry_header.size);
|
||||
/* volume description (utf-16 string) */
|
||||
} else if (entry_type == BITLK_ENTRY_TYPE_DESCRIPTION) {
|
||||
} else if (entry_type == BITLK_ENTRY_TYPE_DESCRIPTION && !params->description) {
|
||||
if (entry_size < BITLK_ENTRY_HEADER_LEN) {
|
||||
r = -EINVAL;
|
||||
goto out;
|
||||
|
||||
Reference in New Issue
Block a user