fix invalid access found by valgrind
authorKevin Coffman <kwc@citi.umich.edu>
Mon, 23 Oct 2006 16:15:50 +0000 (16:15 +0000)
committerKevin Coffman <kwc@citi.umich.edu>
Mon, 23 Oct 2006 16:15:50 +0000 (16:15 +0000)
Valgrind found that we were reading past the end of the
preferred padata string.  p is manually updated within
the loop and there is no need for the increment.  It was
causing the null terminator to be skipped over, rather
than properly terminating the loop.

ticket: new

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@18735 dc483132-0cff-0310-8789-dd5450dbe970

src/lib/krb5/krb/get_in_tkt.c

index 53042fb2cab787e004fef9fcbc8d4c84a1020453..8d75c60c37608937bdb8e00815decead4260bc04 100644 (file)
@@ -795,7 +795,7 @@ sort_krb5_padata_sequence(krb5_context context, krb5_data *realm,
 #endif
 
     base = 0;
-    for (p = preauth_types; *p != '\0'; p++) {
+    for (p = preauth_types; *p != '\0';) {
        /* skip whitespace to find an entry */
        p += strspn(p, ", ");
        if (*p != '\0') {