summaryrefslogtreecommitdiff
path: root/src/regress/lib
diff options
context:
space:
mode:
authortb <>2023-05-13 07:17:32 +0000
committertb <>2023-05-13 07:17:32 +0000
commit17822816765e09b0f009bef1da2b0f3877a33f02 (patch)
treee3f62195128ccb511bff53fbedd65786fe29395f /src/regress/lib
parent3fd5ac06854f326bb86b34f253f0f0edf0281471 (diff)
downloadopenbsd-17822816765e09b0f009bef1da2b0f3877a33f02.tar.gz
openbsd-17822816765e09b0f009bef1da2b0f3877a33f02.tar.bz2
openbsd-17822816765e09b0f009bef1da2b0f3877a33f02.zip
Assert that test->want != NULL at this point
Should make coverity happier
Diffstat (limited to 'src/regress/lib')
-rw-r--r--src/regress/lib/libcrypto/asn1/asn1oct.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/asn1/asn1oct.c b/src/regress/lib/libcrypto/asn1/asn1oct.c
index fef312d739..d989d1e6e3 100644
--- a/src/regress/lib/libcrypto/asn1/asn1oct.c
+++ b/src/regress/lib/libcrypto/asn1/asn1oct.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: asn1oct.c,v 1.3 2023/05/12 10:43:28 tb Exp $ */ 1/* $OpenBSD: asn1oct.c,v 1.4 2023/05/13 07:17:32 tb Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 2023 Theo Buehler <tb@openbsd.org> 4 * Copyright (c) 2023 Theo Buehler <tb@openbsd.org>
@@ -16,6 +16,7 @@
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */ 17 */
18 18
19#include <assert.h>
19#include <err.h> 20#include <err.h>
20#include <string.h> 21#include <string.h>
21 22
@@ -239,6 +240,7 @@ test_s2i_ASN1_OCTET_STRING(const struct s2i_asn1_octet_string_test *test)
239 if ((got = i2s_ASN1_OCTET_STRING(NULL, aos)) == NULL) 240 if ((got = i2s_ASN1_OCTET_STRING(NULL, aos)) == NULL)
240 errx(1, "%s: i2s_ASN1_OCTET_STRING", test->desc); 241 errx(1, "%s: i2s_ASN1_OCTET_STRING", test->desc);
241 242
243 assert(test->want != NULL);
242 if (strcmp(test->want, got) != 0) { 244 if (strcmp(test->want, got) != 0) {
243 fprintf(stderr, "%s: \"%s\" failed: want \"%s\", got \"%s\"\n", 245 fprintf(stderr, "%s: \"%s\" failed: want \"%s\", got \"%s\"\n",
244 __func__, test->desc, test->want, got); 246 __func__, test->desc, test->want, got);