From e7dbd7a1e2ad3e12dafa2919bc8603d60416ea4d 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/x509/x509_att.c | 2 +- src/lib/libcrypto/x509/x509name.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/libcrypto/x509') diff --git a/src/lib/libcrypto/x509/x509_att.c b/src/lib/libcrypto/x509/x509_att.c index 5699568998..ef922c7c83 100644 --- a/src/lib/libcrypto/x509/x509_att.c +++ b/src/lib/libcrypto/x509/x509_att.c @@ -282,7 +282,7 @@ X509_ATTRIBUTE_create_by_txt(X509_ATTRIBUTE **attr, const char *atrname, if (obj == NULL) { X509err(X509_F_X509_ATTRIBUTE_CREATE_BY_TXT, X509_R_INVALID_FIELD_NAME); - ERR_add_error_data(2, "name=", atrname); + ERR_asprintf_error_data("name=%s", atrname); return (NULL); } nattr = X509_ATTRIBUTE_create_by_OBJ(attr, obj, type, bytes, len); diff --git a/src/lib/libcrypto/x509/x509name.c b/src/lib/libcrypto/x509/x509name.c index 3d90fd67fe..32fce2debb 100644 --- a/src/lib/libcrypto/x509/x509name.c +++ b/src/lib/libcrypto/x509/x509name.c @@ -298,7 +298,7 @@ X509_NAME_ENTRY_create_by_txt(X509_NAME_ENTRY **ne, if (obj == NULL) { X509err(X509_F_X509_NAME_ENTRY_CREATE_BY_TXT, X509_R_INVALID_FIELD_NAME); - ERR_add_error_data(2, "name=", field); + ERR_asprintf_error_data("name=%s", field); return (NULL); } nentry = X509_NAME_ENTRY_create_by_OBJ(ne, obj, type, bytes, len); -- cgit v1.2.3-55-g6feb