Avoid segfault in krb5_do_preauth_tryagain
authorKevin Coffman <kwc@citi.umich.edu>
Mon, 23 Oct 2006 16:10:37 +0000 (16:10 +0000)
committerKevin Coffman <kwc@citi.umich.edu>
Mon, 23 Oct 2006 16:10:37 +0000 (16:10 +0000)
Check pointer is non-null before using it.  Avoids segfault in
krb5_do_preauth_tryagain().

ticket: new

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

src/lib/krb5/krb/preauth2.c

index eb1806d1b163b55765ba09c5233d0b30e1d1e40f..ce2bf688344ad188a9711763aee2800583b1263c 100644 (file)
@@ -1239,7 +1239,7 @@ krb5_do_preauth_tryagain(krb5_context kcontext,
        return KRB_ERR_GENERIC;
     }
 
-    for (i = 0; padata[i]->pa_type != 0; i++) {
+    for (i = 0; padata[i] != NULL && padata[i]->pa_type != 0; i++) {
        out_padata = NULL;
        for (j = 0; j < context->n_modules; j++) {
            module = &context->modules[j];