summaryrefslogtreecommitdiffstats
path: root/crypto/asn1/tasn_dec.c
diff options
context:
space:
mode:
authorNils Larsch <nils@openssl.org>2006-02-08 19:51:17 +0100
committerNils Larsch <nils@openssl.org>2006-02-08 19:51:17 +0100
commit82e8372f172e3893c43ef67d99ca114cefe8db3c (patch)
treee7618d6a6a3cf0bb1e33b40feb910141235c96e1 /crypto/asn1/tasn_dec.c
parentmove new member of SSL_SESSION to the end (diff)
downloadopenssl-82e8372f172e3893c43ef67d99ca114cefe8db3c.tar.xz
openssl-82e8372f172e3893c43ef67d99ca114cefe8db3c.zip
p could be uninitialized
Diffstat (limited to 'crypto/asn1/tasn_dec.c')
-rw-r--r--crypto/asn1/tasn_dec.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/crypto/asn1/tasn_dec.c b/crypto/asn1/tasn_dec.c
index ffec26f2f3..4fcc8e86a6 100644
--- a/crypto/asn1/tasn_dec.c
+++ b/crypto/asn1/tasn_dec.c
@@ -158,7 +158,7 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
const ASN1_EXTERN_FUNCS *ef;
const ASN1_AUX *aux = it->funcs;
ASN1_aux_cb *asn1_cb;
- const unsigned char *p, *q;
+ const unsigned char *p = NULL, *q;
unsigned char *wp=NULL; /* BIG FAT WARNING! BREAKS CONST WHERE USED */
unsigned char imphack = 0, oclass;
char seq_eoc, seq_nolen, cst, isopt;
@@ -283,6 +283,12 @@ int ASN1_item_ex_d2i(ASN1_VALUE **pval, const unsigned char **in, long len,
{
wp = *(unsigned char **)in;
imphack = *wp;
+ if (p == NULL)
+ {
+ ASN1err(ASN1_F_ASN1_ITEM_EX_D2I,
+ ERR_R_NESTED_ASN1_ERROR);
+ goto err;
+ }
*wp = (unsigned char)((*p & V_ASN1_CONSTRUCTED)
| it->utype);
}