From dfeaa842f2015d266bd7922b89795a2007e6f497 Mon Sep 17 00:00:00 2001 From: tb <> Date: Sun, 18 May 2025 06:41:51 +0000 Subject: bio_dump: only run strncmp if there's something to compare --- src/regress/lib/libcrypto/bio/bio_dump.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/regress') diff --git a/src/regress/lib/libcrypto/bio/bio_dump.c b/src/regress/lib/libcrypto/bio/bio_dump.c index 22db80fa3d..fd2bb285fb 100644 --- a/src/regress/lib/libcrypto/bio/bio_dump.c +++ b/src/regress/lib/libcrypto/bio/bio_dump.c @@ -1,4 +1,4 @@ -/* $OpenBSD: bio_dump.c,v 1.4 2024/02/09 12:48:32 tb Exp $ */ +/* $OpenBSD: bio_dump.c,v 1.5 2025/05/18 06:41:51 tb Exp $ */ /* * Copyright (c) 2024 Theo Buehler * @@ -809,7 +809,7 @@ bio_dump_test(const struct bio_dump_testcase *tc) tc->indent, ret, got_len, strlen(tc->output)); goto err; } - if (strncmp(tc->output, got, got_len) != 0) { + if (got_len > 0 && strncmp(tc->output, got, got_len) != 0) { fprintf(stderr, "%d: mismatch\n", tc->indent); goto err; } -- cgit v1.2.3-55-g6feb