diff options
author | Bob Beck <beck@cvs.openbsd.org> | 2014-05-30 02:50:11 +0000 |
---|---|---|
committer | Bob Beck <beck@cvs.openbsd.org> | 2014-05-30 02:50:11 +0000 |
commit | 8e9c3c8ab205533cebb588280a86d9ff2ec73fa2 (patch) | |
tree | 79c5bcc88e2ee877ceafbbc874d6d1711a7a0aa7 /lib | |
parent | 535191e7b98c791e3b5dd2e393164e1b0b7c6b04 (diff) |
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')
-rw-r--r-- | lib/libcrypto/ts/ts_lib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libcrypto/ts/ts_lib.c b/lib/libcrypto/ts/ts_lib.c index 81a5f23cd53..b9d92a3012b 100644 --- a/lib/libcrypto/ts/ts_lib.c +++ b/lib/libcrypto/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; } |