diff options
author | 2014-04-26 18:56:37 +0000 | |
---|---|---|
committer | 2014-04-26 18:56:37 +0000 | |
commit | 0f637b92bc02cf08d6ec14891d27a582cbd971ae (patch) | |
tree | 86c57b804d6bfaf4c846d7c286917d8063f541d2 /lib/libssl/src/crypto/bio/b_sock.c | |
parent | sync (diff) | |
download | wireguard-openbsd-0f637b92bc02cf08d6ec14891d27a582cbd971ae.tar.xz wireguard-openbsd-0f637b92bc02cf08d6ec14891d27a582cbd971ae.zip |
Replace all use of ERR_add_error_data with ERR_asprintf_error_data.
This avoids a lot of ugly gymnastics to do snprintfs before sending the
bag of strings to ERR, and eliminates at least one place in dso_dlfctn.c
where it was being called with the incorrect number of arguments and
using random things off the stack as addresses of strings.
ok krw@, jsing@
Diffstat (limited to 'lib/libssl/src/crypto/bio/b_sock.c')
-rw-r--r-- | lib/libssl/src/crypto/bio/b_sock.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/libssl/src/crypto/bio/b_sock.c b/lib/libssl/src/crypto/bio/b_sock.c index 05eb362cc6d..ecfaf93b99d 100644 --- a/lib/libssl/src/crypto/bio/b_sock.c +++ b/lib/libssl/src/crypto/bio/b_sock.c @@ -129,7 +129,7 @@ err: if (locked) CRYPTO_w_unlock(CRYPTO_LOCK_GETHOSTBYNAME); if (err) { - ERR_add_error_data(2, "host=", str); + ERR_asprintf_error_data("host=%s", str); return 0; } else return 1; @@ -171,7 +171,7 @@ BIO_get_port(const char *str, unsigned short *port_ptr) *port_ptr = 70; else { SYSerr(SYS_F_GETSERVBYNAME, errno); - ERR_add_error_data(3, "service='", str, "'"); + ERR_asprintf_error_data("service='%s'", str); return (0); } } @@ -378,7 +378,7 @@ again: s = socket(server.sa.sa_family, SOCK_STREAM, SOCKET_PROTOCOL); if (s == -1) { SYSerr(SYS_F_SOCKET, errno); - ERR_add_error_data(3, "port='", host, "'"); + ERR_asprintf_error_data("port='%s'", host); BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET, BIO_R_UNABLE_TO_CREATE_SOCKET); goto err; } @@ -422,13 +422,13 @@ again: } #endif SYSerr(SYS_F_BIND, err_num); - ERR_add_error_data(3, "port='", host, "'"); + ERR_asprintf_error_data("port='%s'", host); BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET, BIO_R_UNABLE_TO_BIND_SOCKET); goto err; } if (listen(s, MAX_LISTEN) == -1) { SYSerr(SYS_F_BIND, errno); - ERR_add_error_data(3, "port='", host, "'"); + ERR_asprintf_error_data("port='%s'", host); BIOerr(BIO_F_BIO_GET_ACCEPT_SOCKET, BIO_R_UNABLE_TO_LISTEN_SOCKET); goto err; } |