mirror of
https://gitlab.com/cryptsetup/cryptsetup.git
synced 2025-12-13 11:50:10 +01:00
Do not allow segment with size set to 0.
This commit is contained in:
committed by
Milan Broz
parent
c1777cfb89
commit
dfeb5cfdd2
@@ -598,7 +598,7 @@ static int hdr_validate_segments(json_object *hdr_jobj)
|
||||
/* size "dynamic" means whole device starting at 'offset' */
|
||||
if (strcmp(json_object_get_string(jobj_size), "dynamic")) {
|
||||
if (!numbered("size", json_object_get_string(jobj_size)) ||
|
||||
!json_str_to_uint64(jobj_size, &size))
|
||||
!json_str_to_uint64(jobj_size, &size) || !size)
|
||||
return 1;
|
||||
} else
|
||||
size = 0;
|
||||
|
||||
Reference in New Issue
Block a user