krb5 commit [krb5-1.10]: Avoid a crash when attempting to change password

Tom Yu tlyu at MIT.EDU
Wed Aug 29 19:17:30 EDT 2012


https://github.com/krb5/krb5/commit/4499a906d603b834820f2343c40539d6a8ad26c3
commit 4499a906d603b834820f2343c40539d6a8ad26c3
Author: Benjamin Kaduk <kaduk at mit.edu>
Date:   Tue Jul 31 16:12:27 2012 -0400

    Avoid a crash when attempting to change password
    
    In some cases we could keep stack garbage in a local pointer
    variable until the cleanup at the end of the function wherein
    krb5_free_context() would choke on the invalid non-NULL value.
    Initialize to zero to avoid the issue (should be written as NULL
    but stick to the prevailing style).
    
    (cherry picked from commit 023aac4a5d682ffeacc5121deaa771e08a5c9013)
    
    ticket: 7329
    status: resolved

 src/windows/leash/LeashView.cpp |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/windows/leash/LeashView.cpp b/src/windows/leash/LeashView.cpp
index eedc5a2..51777e4 100644
--- a/src/windows/leash/LeashView.cpp
+++ b/src/windows/leash/LeashView.cpp
@@ -1034,7 +1034,7 @@ VOID CLeashView::OnMakeDefault()
 
 VOID CLeashView::OnChangePassword()
 {
-    krb5_context ctx;
+    krb5_context ctx = 0;
     krb5_ccache ccache = 0;
     krb5_principal princ = 0;
     char *pname = NULL;


More information about the cvs-krb5 mailing list