]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
tests: Use STRNEQ_NULLABLE
authorJohn Ferlan <jferlan@redhat.com>
Thu, 27 Sep 2018 23:54:05 +0000 (19:54 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Mon, 1 Oct 2018 18:27:42 +0000 (14:27 -0400)
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@redhat.com>
ACKed-by: Michal Privoznik <mprivozn@redhat.com>
tests/commandtest.c

index 8aa1fdc84efed0572a42208aa7c219c447aea5a9..4d9a468db2deba31b2aaa392a71e3f5ed6a764b3 100644 (file)
@@ -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;
     }