From 5a8717e330a264623a03842afe4db37c1f1d08a9 Mon Sep 17 00:00:00 2001 From: beck <> Date: Wed, 14 Oct 2015 21:25:16 +0000 Subject: Bail out early if we have no buf_len ok miod@ --- src/lib/libcrypto/objects/obj_dat.c | 6 +++++- src/lib/libssl/src/crypto/objects/obj_dat.c | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') 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 @@ -/* $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; 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 @@ -/* $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; -- cgit v1.2.3-55-g6feb