diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-05-02 17:33:50 +0100 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-05-02 22:46:39 +0100 |
commit | 05aef4bbdbc18e7b9490512cdee41e8a608bcc0e (patch) | |
tree | 996bd946930ad9e24c76ea93f7f2570a1b045ccb /crypto/x509 | |
parent | 5a1f853b9870fc32a2e8960763d62209108ff519 (diff) | |
download | openssl-05aef4bbdbc18e7b9490512cdee41e8a608bcc0e.tar.gz |
Fix i2d_X509_AUX: pp can be NULL.
Reported by David Benjamin
Reviewed-by: Emilia Käsper <emilia@openssl.org>
Diffstat (limited to 'crypto/x509')
-rw-r--r-- | crypto/x509/x_x509.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/x509/x_x509.c b/crypto/x509/x_x509.c index 11e758be80..043ab07866 100644 --- a/crypto/x509/x_x509.c +++ b/crypto/x509/x_x509.c @@ -184,14 +184,15 @@ X509 *d2i_X509_AUX(X509 **a, const unsigned char **pp, long length) int i2d_X509_AUX(X509 *a, unsigned char **pp) { int length, tmplen; - unsigned char *start = *pp; + unsigned char *start = pp != NULL ? *pp : NULL; length = i2d_X509(a, pp); if (length < 0 || a == NULL) return length; tmplen = i2d_X509_CERT_AUX(a->aux, pp); if (tmplen < 0) { - *pp = start; + if (start != NULL) + *pp = start; return tmplen; } length += tmplen; |