]> git.ipfire.org Git - thirdparty/krb5.git/commitdiff
Avoid a crash when attempting to change password
authorBenjamin Kaduk <kaduk@mit.edu>
Tue, 31 Jul 2012 20:12:27 +0000 (16:12 -0400)
committerTom Yu <tlyu@mit.edu>
Wed, 29 Aug 2012 22:21:24 +0000 (18:21 -0400)
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

index eedc5a20648668949dbb13f99ba0f24f22f3401f..51777e4081b593edc896853003b93f6b119aed51 100644 (file)
@@ -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;