]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
upstream: Ensure both sides of the test are non-NULL instead of just
authordtucker@openbsd.org <dtucker@openbsd.org>
Mon, 17 Nov 2025 09:59:13 +0000 (09:59 +0000)
committerDarren Tucker <dtucker@dtucker.net>
Mon, 17 Nov 2025 10:36:26 +0000 (21:36 +1100)
either. Coverity CID 443285.

OpenBSD-Regress-ID: aa90e57b1bc8efce9e50734a07a8ffec0680059a

regress/unittests/hostkeys/test_iterate.c

index 65d6d1f4355750f46ea8bdc0030bbc71fbcd303c..a330adce53a9a590a7f0fd4dc00dbfe4ed872d69 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: test_iterate.c,v 1.10 2025/05/06 06:05:48 djm Exp $ */
+/*     $OpenBSD: test_iterate.c,v 1.11 2025/11/17 09:59:13 dtucker Exp $ */
 /*
  * Regress test for hostfile.h hostkeys_foreach()
  *
@@ -133,7 +133,7 @@ check(struct hostkey_foreach_line *l, void *_ctx)
                        ASSERT_INT_EQ(sshkey_equal(l->key, expected->l.key), 1);
                }
        }
-       if (parse_key && !(l->comment == NULL && expected->l.comment == NULL))
+       if (parse_key && l->comment != NULL && expected->l.comment != NULL)
                ASSERT_STRING_EQ(l->comment, expected->l.comment);
        return 0;
 }