[PATCH 03/12] tests: testQemuCapsIterate: Validate suffix

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 tests/testutilsqemu.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/tests/testutilsqemu.c b/tests/testutilsqemu.c
index 7a2ea3bf4e..c602255149 100644
--- a/tests/testutilsqemu.c
+++ b/tests/testutilsqemu.c
@@ -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;
 
-- 
2.21.0

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux