mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2024-12-23 06:05:27 +00:00
storage: reject negative indices
Commit f22b7899
stumbled across a difference between 32-bit and
64-bit platforms when parsing "-1" as an int. Now that we've
fixed that difference, it's time to fix the testsuite.
* src/util/virstoragefile.c (virStorageFileParseChainIndex):
Require a positive index.
Signed-off-by: Eric Blake <eblake@redhat.com>
This commit is contained in:
parent
7b045c8ce9
commit
5c05e2b126
@ -1525,7 +1525,7 @@ virStorageFileParseChainIndex(const char *diskTarget,
|
||||
if (virStringListLength(strings) != 2)
|
||||
goto cleanup;
|
||||
|
||||
if (virStrToLong_ui(strings[1], &suffix, 10, &idx) < 0 ||
|
||||
if (virStrToLong_uip(strings[1], &suffix, 10, &idx) < 0 ||
|
||||
STRNEQ(suffix, "]"))
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user