summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/conf/conf_def.c
diff options
context:
space:
mode:
authorbeck <>2014-04-26 18:56:38 +0000
committerbeck <>2014-04-26 18:56:38 +0000
commite7dbd7a1e2ad3e12dafa2919bc8603d60416ea4d (patch)
treedff54039de6c4454b05953e2ce78edfc5693e6b5 /src/lib/libcrypto/conf/conf_def.c
parenta1c73b72875dcb25545f111b3779cf0f0ebf9c88 (diff)
downloadopenbsd-e7dbd7a1e2ad3e12dafa2919bc8603d60416ea4d.tar.gz
openbsd-e7dbd7a1e2ad3e12dafa2919bc8603d60416ea4d.tar.bz2
openbsd-e7dbd7a1e2ad3e12dafa2919bc8603d60416ea4d.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 'src/lib/libcrypto/conf/conf_def.c')
-rw-r--r--src/lib/libcrypto/conf/conf_def.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/libcrypto/conf/conf_def.c b/src/lib/libcrypto/conf/conf_def.c
index 22fe7a8f60..bc9f139e7e 100644
--- a/src/lib/libcrypto/conf/conf_def.c
+++ b/src/lib/libcrypto/conf/conf_def.c
@@ -218,7 +218,6 @@ def_load_bio(CONF *conf, BIO *in, long *line)
218 char *s, *p, *end; 218 char *s, *p, *end;
219 int again; 219 int again;
220 long eline = 0; 220 long eline = 0;
221 char btmp[DECIMAL_SIZE(eline) + 1];
222 CONF_VALUE *v = NULL, *tv; 221 CONF_VALUE *v = NULL, *tv;
223 CONF_VALUE *sv = NULL; 222 CONF_VALUE *sv = NULL;
224 char *section = NULL, *buf; 223 char *section = NULL, *buf;
@@ -428,8 +427,7 @@ err:
428 free(section); 427 free(section);
429 if (line != NULL) 428 if (line != NULL)
430 *line = eline; 429 *line = eline;
431 snprintf(btmp, sizeof btmp, "%ld", eline); 430 ERR_asprintf_error_data("line %ld", eline);
432 ERR_add_error_data(2, "line ", btmp);
433 if ((h != conf->data) && (conf->data != NULL)) { 431 if ((h != conf->data) && (conf->data != NULL)) {
434 CONF_free(conf->data); 432 CONF_free(conf->data);
435 conf->data = NULL; 433 conf->data = NULL;