Try to be more correct and don't fall off the end. Pointed out by

Kevin Coffman.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@20372 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2007-04-17 17:47:42 +00:00
parent 8a4de2f00a
commit 6f625101d2

View File

@@ -145,10 +145,9 @@ der_get_general_string (const unsigned char *p, size_t len,
* an strings in the NEED_PREAUTH case that includes a
* trailing NUL.
*/
len = p1 - p;
while (*p1 == '\0' && p1 - p < len)
while (p1 - p < len && *p1 == '\0')
p1++;
if (p1 - p != len + 1)
if (p1 - p != len)
return ASN1_BAD_CHARACTER;
}
if (len > len + 1)