summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3
diff options
context:
space:
mode:
authorKurt Roeckx <kurt@roeckx.be>2015-08-17 16:02:18 +0200
committerKurt Roeckx <kurt@roeckx.be>2015-09-14 23:53:03 +0200
commita46c9789ce2aecedceef119e9883513c7a49f1ca (patch)
treeefd119b8addcab9b5e16870dd4dff7da1192bfc6 /crypto/x509v3
parentdf6da24bda457b724ba3e894e6c329a9b93d536f (diff)
d2i: don't update input pointer on failure
Reviewed-by: Dr. Stephen Henson <steve@openssl.org> MR #1005
Diffstat (limited to 'crypto/x509v3')
-rw-r--r--crypto/x509v3/v3_scts.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/crypto/x509v3/v3_scts.c b/crypto/x509v3/v3_scts.c
index f93fdfc2ba..b1505feb35 100644
--- a/crypto/x509v3/v3_scts.c
+++ b/crypto/x509v3/v3_scts.c
@@ -183,8 +183,9 @@ static STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a,
SCT *sct;
unsigned char *p, *p2;
unsigned short listlen, sctlen = 0, fieldlen;
+ const unsigned char *q = *pp;
- if (d2i_ASN1_OCTET_STRING(&oct, pp, length) == NULL)
+ if (d2i_ASN1_OCTET_STRING(&oct, &q, length) == NULL)
return NULL;
if (oct->length < 2)
goto done;
@@ -272,6 +273,7 @@ static STACK_OF(SCT) *d2i_SCT_LIST(STACK_OF(SCT) **a,
done:
ASN1_OCTET_STRING_free(oct);
+ *pp = q;
return sk;
err: