summaryrefslogtreecommitdiffstats
path: root/lib/libssl/src
diff options
context:
space:
mode:
authorbeck <beck@openbsd.org>2014-05-30 02:50:10 +0000
committerbeck <beck@openbsd.org>2014-05-30 02:50:10 +0000
commit1558688741e571a3d2d33462a34491f751e3c2de (patch)
treef6e823b8a97977d0c95723e78175026807605021 /lib/libssl/src
parentremove some of the bigger lies, as applicable to libressl. (diff)
downloadwireguard-openbsd-1558688741e571a3d2d33462a34491f751e3c2de.tar.xz
wireguard-openbsd-1558688741e571a3d2d33462a34491f751e3c2de.zip
Don't write out more than we have allocated in obj_txt, as the glory
that is OBJ_obj2txt() can return a larger value.. ok tedu@
Diffstat (limited to 'lib/libssl/src')
-rw-r--r--lib/libssl/src/crypto/ts/ts_lib.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libssl/src/crypto/ts/ts_lib.c b/lib/libssl/src/crypto/ts/ts_lib.c
index 81a5f23cd53..b9d92a3012b 100644
--- a/lib/libssl/src/crypto/ts/ts_lib.c
+++ b/lib/libssl/src/crypto/ts/ts_lib.c
@@ -92,9 +92,10 @@ TS_OBJ_print_bio(BIO *bio, const ASN1_OBJECT *obj)
char obj_txt[128];
int len = OBJ_obj2txt(obj_txt, sizeof(obj_txt), obj, 0);
+ if (len >= sizeof(obj_txt))
+ len = sizeof(obj_txt) - 1;
BIO_write(bio, obj_txt, len);
BIO_write(bio, "\n", 1);
-
return 1;
}