mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-03 03:25:20 +00:00
tests: testQemuCapsIterate: Validate suffix
We're going to depend on the fact that the suffix starts with a dot later on, so we better ensure that it does. Signed-off-by: Andrea Bolognani <abologna@redhat.com> Reviewed-by: Jiri Denemark <jdenemar@redhat.com>
This commit is contained in:
parent
85394f676d
commit
29795544fd
@ -906,6 +906,12 @@ testQemuCapsIterate(const char *suffix,
|
||||
if (!callback)
|
||||
return 0;
|
||||
|
||||
/* Validate suffix */
|
||||
if (!STRPREFIX(suffix, ".")) {
|
||||
VIR_TEST_VERBOSE("malformed suffix '%s'", suffix);
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
if (virDirOpen(&dir, TEST_QEMU_CAPS_PATH) < 0)
|
||||
goto cleanup;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user