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/pkcs7/bio_ber.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/pkcs7/bio_ber.c')
| -rw-r--r-- | src/lib/libcrypto/pkcs7/bio_ber.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/libcrypto/pkcs7/bio_ber.c b/src/lib/libcrypto/pkcs7/bio_ber.c index 04dc5c9b96..d787495a21 100644 --- a/src/lib/libcrypto/pkcs7/bio_ber.c +++ b/src/lib/libcrypto/pkcs7/bio_ber.c | |||
| @@ -155,7 +155,6 @@ static int ber_free(BIO *a) | |||
| 155 | 155 | ||
| 156 | int bio_ber_get_header(BIO *bio, BIO_BER_CTX *ctx) | 156 | int bio_ber_get_header(BIO *bio, BIO_BER_CTX *ctx) |
| 157 | { | 157 | { |
| 158 | char buf[64]; | ||
| 159 | int i,j,n; | 158 | int i,j,n; |
| 160 | int ret; | 159 | int ret; |
| 161 | unsigned char *p; | 160 | unsigned char *p; |
| @@ -215,8 +214,7 @@ int bio_ber_get_header(BIO *bio, BIO_BER_CTX *ctx) | |||
| 215 | if ((ctx->tag >= 0) && (ctx->tag != tag)) | 214 | if ((ctx->tag >= 0) && (ctx->tag != tag)) |
| 216 | { | 215 | { |
| 217 | BIOerr(BIO_F_BIO_BER_GET_HEADER,BIO_R_TAG_MISMATCH); | 216 | BIOerr(BIO_F_BIO_BER_GET_HEADER,BIO_R_TAG_MISMATCH); |
| 218 | sprintf(buf,"tag=%d, got %d",ctx->tag,tag); | 217 | ERR_asprintf_error_data("tag=%d, got %d", ctx->tag, tag); |
| 219 | ERR_add_error_data(1,buf); | ||
| 220 | return(-1); | 218 | return(-1); |
| 221 | } | 219 | } |
| 222 | if (ret & 0x01) | 220 | if (ret & 0x01) |
