if (node->type & CONST_TAG)
{
p = node->down;
+ if (p == NULL)
+ return ASN1_DER_ERROR;
/* When there are nested tags we must complete them reverse to
the order they were created. This is because completing a tag
modifies all data within it, including the incomplete tags
struct vet *first, *last, *p_vet, *p2_vet;
asn1_node p;
unsigned char class, *temp;
- unsigned long tag;
+ unsigned long tag, t;
counter = 0;
return;
p = node->down;
- while ((type_field (p->type) == ASN1_ETYPE_TAG)
- || (type_field (p->type) == ASN1_ETYPE_SIZE))
+ while (p && ((type_field (p->type) == ASN1_ETYPE_TAG) ||
+ (type_field (p->type) == ASN1_ETYPE_SIZE)))
p = p->right;
if ((p == NULL) || (p->right == NULL))
(der + counter, der_len - counter, &class, &len2,
&tag) != ASN1_SUCCESS)
return;
- p_vet->value = (class << 24) | tag;
+
+ t = class << 24;
+ p_vet->value = t | tag;
counter += len2;
/* extraction and length */
return;
p = node->down;
- while ((type_field (p->type) == ASN1_ETYPE_TAG)
- || (type_field (p->type) == ASN1_ETYPE_SIZE))
+ while (p && ((type_field (p->type) == ASN1_ETYPE_TAG) ||
+ (type_field (p->type) == ASN1_ETYPE_SIZE)))
p = p->right;
p = p->right;
while (p)
{
- if ((p->name) && nhash == p->name_hash && (!strcmp (p->name, n)))
+ if (nhash == p->name_hash && (!strcmp (p->name, n)))
break;
else
p = p->right;
p = node;
while (p)
{
- if (type_field (p->type) == ASN1_ETYPE_IDENTIFIER)
+ if (p->value && type_field (p->type) == ASN1_ETYPE_IDENTIFIER)
{
_asn1_str_cpy (name2, sizeof (name2), node->name);
_asn1_str_cat (name2, sizeof (name2), ".");