diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2015-06-12 22:18:36 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2015-06-13 12:25:42 +0100 |
commit | f2dc4d517fa11208b90ba0e92a2590f8cfdafb28 (patch) | |
tree | 5ebcfd486230d18c44503f6d62bf056c66cc2977 /crypto/asn1 | |
parent | 1ae3fdbe6a7e78eef4d7678cb08ff468481c24ad (diff) | |
download | openssl-f2dc4d517fa11208b90ba0e92a2590f8cfdafb28.tar.gz |
Encode b == NULL or blen == 0 as zero.
PR#3904
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/a_int.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/asn1/a_int.c b/crypto/asn1/a_int.c index 9a58378b8a..0d020e0c13 100644 --- a/crypto/asn1/a_int.c +++ b/crypto/asn1/a_int.c @@ -158,8 +158,8 @@ static size_t i2c_ibuf(const unsigned char *b, size_t blen, int neg, if (pad) *(p++) = pb; - if (blen == 0) - *(p++) = 0; + if (b == NULL || blen == 0) + *p = 0; else if (!neg) memcpy(p, b, blen); else { |