Add a sanity check in asn1_der_decoding_startEnd()
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Mon, 2 Jun 2014 08:49:55 +0000 (10:49 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Tue, 3 Jun 2014 13:42:22 +0000 (15:42 +0200)
lib/decoding.c

index 8f6fe8a..54f0167 100644 (file)
@@ -1581,6 +1581,9 @@ asn1_der_decoding_startEnd (asn1_node element, const void *ider, int ider_len,
       *end = node_to_find->end;
     }
 
+  if (*end < *start)
+    return ASN1_GENERIC_ERROR;
+
   return ASN1_SUCCESS;
 }