diff options
| author | beck <> | 2014-04-26 18:56:38 +0000 |
|---|---|---|
| committer | beck <> | 2014-04-26 18:56:38 +0000 |
| commit | e7dbd7a1e2ad3e12dafa2919bc8603d60416ea4d (patch) | |
| tree | dff54039de6c4454b05953e2ce78edfc5693e6b5 /src/lib/libcrypto/bio/bss_file.c | |
| parent | a1c73b72875dcb25545f111b3779cf0f0ebf9c88 (diff) | |
| download | openbsd-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/bio/bss_file.c')
| -rw-r--r-- | src/lib/libcrypto/bio/bss_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/libcrypto/bio/bss_file.c b/src/lib/libcrypto/bio/bss_file.c index acc746260e..6d5444f666 100644 --- a/src/lib/libcrypto/bio/bss_file.c +++ b/src/lib/libcrypto/bio/bss_file.c | |||
| @@ -122,7 +122,7 @@ BIO_new_file(const char *filename, const char *mode) | |||
| 122 | 122 | ||
| 123 | if (file == NULL) { | 123 | if (file == NULL) { |
| 124 | SYSerr(SYS_F_FOPEN, errno); | 124 | SYSerr(SYS_F_FOPEN, errno); |
| 125 | ERR_add_error_data(5, "fopen('", filename, "', '", mode, "')"); | 125 | ERR_asprintf_error_data("fopen('%s', '%s')", filename, mode); |
| 126 | if (errno == ENOENT) | 126 | if (errno == ENOENT) |
| 127 | BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE); | 127 | BIOerr(BIO_F_BIO_NEW_FILE, BIO_R_NO_SUCH_FILE); |
| 128 | else | 128 | else |
| @@ -262,7 +262,7 @@ file_ctrl(BIO *b, int cmd, long num, void *ptr) | |||
| 262 | fp = fopen(ptr, p); | 262 | fp = fopen(ptr, p); |
| 263 | if (fp == NULL) { | 263 | if (fp == NULL) { |
| 264 | SYSerr(SYS_F_FOPEN, errno); | 264 | SYSerr(SYS_F_FOPEN, errno); |
| 265 | ERR_add_error_data(5, "fopen('", ptr, "', '", p, "')"); | 265 | ERR_asprintf_error_data("fopen('%s', '%s')", ptr, p); |
| 266 | BIOerr(BIO_F_FILE_CTRL, ERR_R_SYS_LIB); | 266 | BIOerr(BIO_F_FILE_CTRL, ERR_R_SYS_LIB); |
| 267 | ret = 0; | 267 | ret = 0; |
| 268 | break; | 268 | break; |
