From 715a2c58fe812af3f07885ee27a3fc208e84c5ce Mon Sep 17 00:00:00 2001 From: beck <> Date: Mon, 14 Apr 2014 18:53:14 +0000 Subject: Flense all use of BIO_snprintf from ssl source - use the real one instead, and allow for the normal posix mandated return values instead of the nonstandard one from BIO_snprintf. ok miod@ --- src/lib/libssl/ssl_ciph.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/lib/libssl/ssl_ciph.c') diff --git a/src/lib/libssl/ssl_ciph.c b/src/lib/libssl/ssl_ciph.c index f37c70cf91..0e24e0a5c6 100644 --- a/src/lib/libssl/ssl_ciph.c +++ b/src/lib/libssl/ssl_ciph.c @@ -1499,7 +1499,7 @@ const char *rule_str) char *SSL_CIPHER_description(const SSL_CIPHER *cipher, char *buf, int len) { - int is_export, pkl, kl; + int is_export, pkl, kl, l; const char *ver, *exp_str; const char *kx, *au, *enc, *mac; unsigned long alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl, alg2; @@ -1672,11 +1672,14 @@ char return("Buffer too small"); #ifdef KSSL_DEBUG - BIO_snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str, alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl); + l = snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str, alg_mkey, alg_auth, alg_enc, alg_mac, alg_ssl); #else - BIO_snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str); + l = snprintf(buf, len, format, cipher->name, ver, kx, au, enc, mac, exp_str); #endif /* KSSL_DEBUG */ - return (buf); + if (l >= len || l == -1) + return("Buffer too small"); + else + return (buf); } char -- cgit v1.2.3-55-g6feb