diff options
author | Loganaden Velvindron <logan@cvs.openbsd.org> | 2014-06-04 20:04:56 +0000 |
---|---|---|
committer | Loganaden Velvindron <logan@cvs.openbsd.org> | 2014-06-04 20:04:56 +0000 |
commit | 3bcee51c7f0e901c4541d77ae14246e1f6b1cbf8 (patch) | |
tree | 43de2461c46215693cecc350e909fd8622c46f6a /lib/libcrypto | |
parent | ad6177b2f5ad04223501eabac49eea913f229ab4 (diff) |
Fix a leak that can occur when len == 0, and as a result we leak a \0 byte.
(From Frantisek Boranek)
OK from miod@
Diffstat (limited to 'lib/libcrypto')
-rw-r--r-- | lib/libcrypto/pkcs12/p12_kiss.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/libcrypto/pkcs12/p12_kiss.c b/lib/libcrypto/pkcs12/p12_kiss.c index bc1fcff45df..cfefc6aaac4 100644 --- a/lib/libcrypto/pkcs12/p12_kiss.c +++ b/lib/libcrypto/pkcs12/p12_kiss.c @@ -269,7 +269,7 @@ static int parse_bag(PKCS12_SAFEBAG *bag, const char *pass, int passlen, int len, r; unsigned char *data; len = ASN1_STRING_to_UTF8(&data, fname); - if(len > 0) { + if(len >= 0) { r = X509_alias_set1(x509, data, len); free(data); if (!r) |