From 47bb6e76785f0b1c4d19d8d0a02f3eb3813f96e2 Mon Sep 17 00:00:00 2001 From: beck <> Date: Sat, 26 Apr 2014 18:56:38 +0000 Subject: 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@ --- src/lib/libcrypto/comp/c_zlib.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/comp/c_zlib.c') diff --git a/src/lib/libcrypto/comp/c_zlib.c b/src/lib/libcrypto/comp/c_zlib.c index aaf89429b6..3a73b3df0b 100644 --- a/src/lib/libcrypto/comp/c_zlib.c +++ b/src/lib/libcrypto/comp/c_zlib.c @@ -551,7 +551,7 @@ bio_zlib_read(BIO *b, char *out, int outl) if ((ret != Z_OK) && (ret != Z_STREAM_END)) { COMPerr(COMP_F_BIO_ZLIB_READ, COMP_R_ZLIB_INFLATE_ERROR); - ERR_add_error_data(2, "zlib error:", + ERR_asprintf_error_data("zlib error:%s", zError(ret)); return 0; } @@ -638,7 +638,7 @@ bio_zlib_write(BIO *b, const char *in, int inl) if (ret != Z_OK) { COMPerr(COMP_F_BIO_ZLIB_WRITE, COMP_R_ZLIB_DEFLATE_ERROR); - ERR_add_error_data(2, "zlib error:", zError(ret)); + ERR_asprintf_error_data("zlib error:%s", zError(ret)); return 0; } ctx->ocount = ctx->obufsize - zout->avail_out; @@ -688,7 +688,7 @@ bio_zlib_flush(BIO *b) else if (ret != Z_OK) { COMPerr(COMP_F_BIO_ZLIB_FLUSH, COMP_R_ZLIB_DEFLATE_ERROR); - ERR_add_error_data(2, "zlib error:", zError(ret)); + ERR_asprintf_error_data("zlib error:%s", zError(ret)); return 0; } ctx->ocount = ctx->obufsize - zout->avail_out; -- cgit v1.2.3-55-g6feb