[PATCH 6/7] tests: Use STRNEQ_NULLABLE

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

 



It's possible that the @outbuf and/or @errbuf could be NULL
and thus we need to use the right comparison macro.

Found by Coverity

Signed-off-by: John Ferlan <jferlan@xxxxxxxxxx>
---
 tests/commandtest.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/commandtest.c b/tests/commandtest.c
index 8aa1fdc84e..4d9a468db2 100644
--- a/tests/commandtest.c
+++ b/tests/commandtest.c
@@ -875,12 +875,12 @@ static int test21(const void *unused ATTRIBUTE_UNUSED)
     if (virTestGetVerbose())
         printf("STDOUT:%s\nSTDERR:%s\n", NULLSTR(outbuf), NULLSTR(errbuf));
 
-    if (STRNEQ(outbuf, outbufExpected)) {
+    if (STRNEQ_NULLABLE(outbuf, outbufExpected)) {
         virTestDifference(stderr, outbufExpected, outbuf);
         goto cleanup;
     }
 
-    if (STRNEQ(errbuf, errbufExpected)) {
+    if (STRNEQ_NULLABLE(errbuf, errbufExpected)) {
         virTestDifference(stderr, errbufExpected, errbuf);
         goto cleanup;
     }
-- 
2.17.1

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