Fix #7994 - crash in pkcs7 parser

This commit is contained in:
pancake 2017-07-24 01:37:59 +02:00
parent dde903aa7b
commit 2504b84954

View File

@ -324,7 +324,10 @@ RPKCS7Attribute* r_pkcs7_parse_attribute (RASN1Object *object) {
attribute->oid = r_asn1_stringify_oid (object->list.objects[0]->sector, object->list.objects[0]->length);
}
if (object->list.length == 2) {
attribute->data = r_asn1_create_binary (object->list.objects[1]->sector, object->list.objects[1]->length);
RASN1Object * obj1 = object->list.objects[1];
if (obj1) {
attribute->data = r_asn1_create_binary (obj1->sector, obj1->length);
}
}
return attribute;
}