Skip to content

Commit

Permalink
Fix radareorg#7152 - Null deref in cms
Browse files Browse the repository at this point in the history
  • Loading branch information
wargio authored and radare committed Mar 27, 2017
1 parent 6de4961 commit 7ab66cc
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libr/util/r_pkcs7.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,9 @@ RCMS *r_pkcs7_parse_cms (const ut8 *buffer, ut32 length) {
return NULL;
}
object = r_asn1_create_object (buffer, length);
if (!object || object->list.length != 2 || !object->list.objects[0] || object->list.objects[1]->list.length != 1) {
if (!object || object->list.length != 2 || !object->list.objects ||
!object->list.objects[0] || !object->list.objects[1] ||
object->list.objects[1]->list.length != 1) {
r_asn1_free_object (object);
free (container);
return NULL;
Expand Down

0 comments on commit 7ab66cc

Please sign in to comment.