[PATCH 1/3] test_driver: validate @source in testDomainInterfaceAddresses

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

 



Signed-off-by: Ilias Stamatis <stamatis.iliass@xxxxxxxxx>
---
 src/test/test_driver.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/test/test_driver.c b/src/test/test_driver.c
index 8ef843b203..437df9cdf9 100644
--- a/src/test/test_driver.c
+++ b/src/test/test_driver.c
@@ -3383,7 +3383,7 @@ static int testDomainBlockStats(virDomainPtr domain,
 static int
 testDomainInterfaceAddresses(virDomainPtr dom,
                              virDomainInterfacePtr **ifaces,
-                             unsigned int source ATTRIBUTE_UNUSED,
+                             unsigned int source,
                              unsigned int flags)
 {
     size_t i;
@@ -3396,6 +3396,13 @@ testDomainInterfaceAddresses(virDomainPtr dom,

     virCheckFlags(0, -1);

+    if (source >= VIR_DOMAIN_INTERFACE_ADDRESSES_SRC_LAST) {
+        virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED,
+                       _("Unknown IP address data source %d"),
+                       source);
+        return -1;
+    }
+
     if (!(vm = testDomObjFromDomain(dom)))
         goto cleanup;

--
2.22.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