More precise length check in _asn1_get_indefinite_length_string().
authorNikos Mavrogiannopoulos <nmav@gnutls.org>
Fri, 16 May 2014 06:08:02 +0000 (08:08 +0200)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 16 May 2014 06:55:08 +0000 (08:55 +0200)
lib/decoding.c

index 813afc0..0e5077f 100644 (file)
@@ -772,7 +772,7 @@ _asn1_get_indefinite_length_string (const unsigned char *der, int *len)
 
   while (1)
     {
-      if ((*len) < counter)
+      if (counter+1 >= *len)
        return ASN1_DER_ERROR;
 
       if ((der[counter] == 0) && (der[counter + 1] == 0))