From: dtucker@openbsd.org Date: Mon, 17 Nov 2025 09:59:13 +0000 (+0000) Subject: upstream: Ensure both sides of the test are non-NULL instead of just X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2fe6e406b496b54351dab923f9be95579d39d071;p=thirdparty%2Fopenssh-portable.git upstream: Ensure both sides of the test are non-NULL instead of just either. Coverity CID 443285. OpenBSD-Regress-ID: aa90e57b1bc8efce9e50734a07a8ffec0680059a --- diff --git a/regress/unittests/hostkeys/test_iterate.c b/regress/unittests/hostkeys/test_iterate.c index 65d6d1f43..a330adce5 100644 --- a/regress/unittests/hostkeys/test_iterate.c +++ b/regress/unittests/hostkeys/test_iterate.c @@ -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; }