krb5 commit: Fix crash on invalid DIR ccache primary file

Greg Hudson ghudson at MIT.EDU
Mon Jun 25 11:21:05 EDT 2012


https://github.com/krb5/krb5/commit/036ca94bdc00cc8eb248dc5c0da85ab556d3373e
commit 036ca94bdc00cc8eb248dc5c0da85ab556d3373e
Author: Greg Hudson <ghudson at mit.edu>
Date:   Mon Jun 25 11:19:56 2012 -0400

    Fix crash on invalid DIR ccache primary file
    
    If read_primary_file() fails with an error other than ENOENT, abort
    cache resolution rather than dereferencing a null pointer.  Reported
    by Oliver Loch.
    
    ticket: 7185
    target_version: 1.10.3
    tags: pullup

 src/lib/krb5/ccache/cc_dir.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/lib/krb5/ccache/cc_dir.c b/src/lib/krb5/ccache/cc_dir.c
index d77cce4..f241c0a 100644
--- a/src/lib/krb5/ccache/cc_dir.c
+++ b/src/lib/krb5/ccache/cc_dir.c
@@ -343,9 +343,9 @@ dcc_resolve(krb5_context context, krb5_ccache *cache_out, const char *residual)
             if (ret)
                 goto cleanup;
             ret = subsidiary_residual(residual, "tkt", &sresidual);
-            if (ret)
-                goto cleanup;
         }
+        if (ret)
+            goto cleanup;
         residual = sresidual;
     }
 


More information about the cvs-krb5 mailing list