]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Fix returning KDB_NOENTRY in find_alternate_tgs()
authorNalin Dahyabhai <nalin@dahyabhai.net>
Thu, 20 Feb 2014 21:01:49 +0000 (16:01 -0500)
committerTom Yu <tlyu@mit.edu>
Fri, 6 Feb 2015 22:05:37 +0000 (17:05 -0500)
After searching for a cross-realm TGS entry to provide to a client as a
referral, if we're all set to return a success code but aren't actually
returning an entry, we should be returning an error.  We might not do so
because we don't compare the right value against NULL.

This corrects an error in a redundant check in the patch for
CVE-2013-1417.  The error in the check cannot occur in practice
because the other part of the patch for CVE-2013-1417 prevents it, but
static analyzers can flag the erroneous check.

[tlyu@mit.edu: edit commit message]

(cherry picked from commit 90cbf4eb60d8ec3c083195ba4a050a31ea36be0b)

ticket: 8092 (new)
version_fixed: 1.11.6
status: resolved

src/kdc/do_tgs_req.c

index e3fdce469ec946cf792d7e2f39cdf55096a7562e..a90eeabb1333cfcb15667f54cbf8e462858f232a 100644 (file)
@@ -1063,7 +1063,7 @@ find_alternate_tgs(kdc_realm_t *kdc_active_realm, krb5_principal princ,
         goto cleanup;
     }
 cleanup:
-    if (retval == 0 && server_ptr == NULL)
+    if (retval == 0 && *server_ptr == NULL)
         retval = KRB5_KDB_NOENTRY;
     if (retval != 0)
         *status = "UNKNOWN_SERVER";