summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorbeck <>2015-10-14 21:25:16 +0000
committerbeck <>2015-10-14 21:25:16 +0000
commit5a8717e330a264623a03842afe4db37c1f1d08a9 (patch)
treec98623a77fc51c3f3d4d8fdfed76eb9dc9bcb72e /src
parente8ea76a11af489c64a364323e8d0402a41f9cb90 (diff)
downloadopenbsd-5a8717e330a264623a03842afe4db37c1f1d08a9.tar.gz
openbsd-5a8717e330a264623a03842afe4db37c1f1d08a9.tar.bz2
openbsd-5a8717e330a264623a03842afe4db37c1f1d08a9.zip
Bail out early if we have no buf_len
ok miod@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/objects/obj_dat.c6
-rw-r--r--src/lib/libssl/src/crypto/objects/obj_dat.c6
2 files changed, 10 insertions, 2 deletions
diff --git a/src/lib/libcrypto/objects/obj_dat.c b/src/lib/libcrypto/objects/obj_dat.c
index dab860d85c..dd5d50122b 100644
--- a/src/lib/libcrypto/objects/obj_dat.c
+++ b/src/lib/libcrypto/objects/obj_dat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: obj_dat.c,v 1.33 2015/10/14 21:12:10 tedu Exp $ */ 1/* $OpenBSD: obj_dat.c,v 1.34 2015/10/14 21:25:16 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -565,6 +565,10 @@ OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
565 ret++; 565 ret++;
566 } 566 }
567 567
568 if (buf_len <= 0) {
569 ret = 0;
570 goto out;
571 }
568 if (use_bn) { 572 if (use_bn) {
569 char *bndec; 573 char *bndec;
570 574
diff --git a/src/lib/libssl/src/crypto/objects/obj_dat.c b/src/lib/libssl/src/crypto/objects/obj_dat.c
index dab860d85c..dd5d50122b 100644
--- a/src/lib/libssl/src/crypto/objects/obj_dat.c
+++ b/src/lib/libssl/src/crypto/objects/obj_dat.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: obj_dat.c,v 1.33 2015/10/14 21:12:10 tedu Exp $ */ 1/* $OpenBSD: obj_dat.c,v 1.34 2015/10/14 21:25:16 beck Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -565,6 +565,10 @@ OBJ_obj2txt(char *buf, int buf_len, const ASN1_OBJECT *a, int no_name)
565 ret++; 565 ret++;
566 } 566 }
567 567
568 if (buf_len <= 0) {
569 ret = 0;
570 goto out;
571 }
568 if (use_bn) { 572 if (use_bn) {
569 char *bndec; 573 char *bndec;
570 574