krb5 commit: Avoid a crash when attempting to change password

Benjamin Kaduk kaduk at MIT.EDU
Wed Aug 29 16:34:52 EDT 2012


https://github.com/krb5/krb5/commit/023aac4a5d682ffeacc5121deaa771e08a5c9013
commit 023aac4a5d682ffeacc5121deaa771e08a5c9013
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).
    
    ticket: 7329 (new)
    queue: kfw
    target_version: 1.10.4
    tags: pullup

 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