summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartijn <martijn@openbsd.org>2020-09-03 19:09:57 +0000
committermartijn <martijn@openbsd.org>2020-09-03 19:09:57 +0000
commit00f4a9fb7d9d4e0b3944514906ce42584c431a7c (patch)
treed66d1b2b2eda45f947e8af5e420fbf0932f46e0f
parentIf .ti had an excessive argument, using it was attempted, in some (diff)
downloadwireguard-openbsd-00f4a9fb7d9d4e0b3944514906ce42584c431a7c.tar.xz
wireguard-openbsd-00f4a9fb7d9d4e0b3944514906ce42584c431a7c.zip
Missed one case of errno not being set in previous.
double check and OK tb@
-rw-r--r--lib/libutil/ber.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libutil/ber.c b/lib/libutil/ber.c
index d7cc863eaeb..1698aad6147 100644
--- a/lib/libutil/ber.c
+++ b/lib/libutil/ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber.c,v 1.16 2020/09/03 17:01:15 martijn Exp $ */
+/* $OpenBSD: ber.c,v 1.17 2020/09/03 19:09:57 martijn Exp $ */
/*
* Copyright (c) 2007, 2012 Reyk Floeter <reyk@openbsd.org>
@@ -1258,8 +1258,10 @@ ober_read_element(struct ber *ber, struct ber_element *elm)
}
case BER_TYPE_INTEGER:
case BER_TYPE_ENUMERATED:
- if (len > (ssize_t)sizeof(long long))
+ if (len > (ssize_t)sizeof(long long)) {
+ errno = ERANGE;
return -1;
+ }
for (i = 0; i < len; i++) {
if (ober_getc(ber, &c) != 1)
return -1;