diff options
author | 2019-06-28 05:47:57 +0000 | |
---|---|---|
committer | 2019-06-28 05:47:57 +0000 | |
commit | 688b311876356d64386954323c9c5d304461cae7 (patch) | |
tree | 0b9edbf146bf040ba880273c93404b7036485952 /lib | |
parent | Remove some debug echos (diff) | |
download | wireguard-openbsd-688b311876356d64386954323c9c5d304461cae7.tar.xz wireguard-openbsd-688b311876356d64386954323c9c5d304461cae7.zip |
failed to detect asprintf() error by observing return of -1, instead the
code was inspecting the pointer (which is, sadly, undefined on error, because
the current specification of asprintf is crazy sloppy)
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/bio/b_print.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/lib/libcrypto/bio/b_print.c b/lib/libcrypto/bio/b_print.c index 09747767dde..c9d54809a76 100644 --- a/lib/libcrypto/bio/b_print.c +++ b/lib/libcrypto/bio/b_print.c @@ -1,4 +1,4 @@ -/* $OpenBSD: b_print.c,v 1.25 2014/06/12 15:49:28 deraadt Exp $ */ +/* $OpenBSD: b_print.c,v 1.26 2019/06/28 05:47:57 deraadt Exp $ */ /* Theo de Raadt places this file in the public domain. */ @@ -49,13 +49,10 @@ BIO_vprintf(BIO *bio, const char *format, va_list args) char *buf = NULL; ret = vasprintf(&buf, format, args); - if (buf == NULL) { - ret = -1; - goto fail; - } + if (ret == -1) + return (ret); BIO_write(bio, buf, ret); free(buf); -fail: return (ret); } |