summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/objects/obj_dat.c
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2015-10-14 21:25:16 +0000
committerbeck <beck@openbsd.org>2015-10-14 21:25:16 +0000
commit0ce9fa2c88c8a534029cf435d5108d453acba3b3 (patch)
tree396458531814444bb3c5b244d8c580f444ef0245 /lib/libcrypto/objects/obj_dat.c
parentwhitespace + only log TRACE_MPROC if not IMSG_STAT_{IN,DE}CREMENT (diff)
downloadwireguard-openbsd-0ce9fa2c88c8a534029cf435d5108d453acba3b3.tar.xz
wireguard-openbsd-0ce9fa2c88c8a534029cf435d5108d453acba3b3.zip
Bail out early if we have no buf_len
ok miod@
Diffstat (limited to 'lib/libcrypto/objects/obj_dat.c')
-rw-r--r--lib/libcrypto/objects/obj_dat.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/libcrypto/objects/obj_dat.c b/lib/libcrypto/objects/obj_dat.c
index dab860d85c0..dd5d50122b9 100644
--- a/lib/libcrypto/objects/obj_dat.c
+++ b/lib/libcrypto/objects/obj_dat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: obj_dat.c,v 1.33 2015/10/14 21:12:10 tedu Exp $ */
+/* $OpenBSD: obj_dat.c,v 1.34 2015/10/14 21:25:16 beck Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
@@ -565,6 +565,10 @@ OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
ret++;
}
+ if (buf_len <= 0) {
+ ret = 0;
+ goto out;
+ }
if (use_bn) {
char *bndec;