summaryrefslogtreecommitdiff
path: root/lib/libutil
diff options
context:
space:
mode:
authorGerhard Roth <gerhard@cvs.openbsd.org>2023-08-22 12:50:28 +0000
committerGerhard Roth <gerhard@cvs.openbsd.org>2023-08-22 12:50:28 +0000
commitbcf5c830a88a87e2a0de0745eb8539238479ba85 (patch)
treed7828b8153831ea2497aa0494c10a46ffbb03f72 /lib/libutil
parente0902b0f935fee6b1e42481ead91dab68030d6f0 (diff)
Don't fail in ober_scanf_elements() when encountering empty sequences.
Ok martijn@
Diffstat (limited to 'lib/libutil')
-rw-r--r--lib/libutil/ber.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libutil/ber.c b/lib/libutil/ber.c
index 3a192748edf..cd3bcd0623a 100644
--- a/lib/libutil/ber.c
+++ b/lib/libutil/ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber.c,v 1.24 2022/11/03 17:58:10 martijn Exp $ */
+/* $OpenBSD: ber.c,v 1.25 2023/08/22 12:50:27 gerhard Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -797,7 +797,7 @@ ober_scanf_elements(struct ber_element *ber, char *fmt, ...)
if (ber->be_encoding != BER_TYPE_SEQUENCE &&
ber->be_encoding != BER_TYPE_SET)
goto fail;
- if (ber->be_sub == NULL || level >= _MAX_SEQ-1)
+ if (level >= _MAX_SEQ-1)
goto fail;
parent[++level] = ber;
ber = ber->be_sub;