Fix i2d_X509_AUX: pp can be NULL.
Reported by David Benjamin Reviewed-by: Emilia Käsper <emilia@openssl.org>
This commit is contained in:
parent
5a1f853b98
commit
05aef4bbdb
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue