Browse Source

Sync with upstream on i2d_X509_AUX.

Upstream decided to reset *pp on error and to later fix up the other i2d
functions to behave similarly. See upstream's
c5e603ee18.

Change-Id: I01f82b578464060d0f2be5460fe4c1b969124c8e
Reviewed-on: https://boringssl-review.googlesource.com/7844
Reviewed-by: Adam Langley <agl@google.com>
kris/onging/CECPQ3_patch15
David Benjamin 8 years ago
committed by Adam Langley
parent
commit
a43fd90c5d
1 changed files with 3 additions and 0 deletions
  1. +3
    -0
      crypto/x509/x_x509.c

+ 3
- 0
crypto/x509/x_x509.c View File

@@ -207,6 +207,7 @@ 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 != NULL ? *pp : NULL;
length = i2d_X509(a, pp);
if (length < 0 || a == NULL) {
return length;
@@ -214,6 +215,8 @@ int i2d_X509_AUX(X509 *a, unsigned char **pp)

tmplen = i2d_X509_CERT_AUX(a->aux, pp);
if (tmplen < 0) {
if (start != NULL)
*pp = start;
return tmplen;
}
length += tmplen;


Loading…
Cancel
Save