Fix clearing password in memory
[hcoop/debian/libapache-mod-waklog.git] / mod_waklog.c
index 704b2b4..07f1339 100644 (file)
@@ -464,11 +464,11 @@ set_auth ( server_rec *s, request_rec *r, int self, char *principal, char *keyta
                 log_error(APLOG_MARK, APLOG_ERR, 0, s, "mod_waklog: krb5_get_init_creds_password %s",
                   error_message(kerror) );
                   /* nuke the password so it doesn't end up in core files */
                 log_error(APLOG_MARK, APLOG_ERR, 0, s, "mod_waklog: krb5_get_init_creds_password %s",
                   error_message(kerror) );
                   /* nuke the password so it doesn't end up in core files */
-                  memset(k5secret, 0, sizeof(k5secret));               
+                  memset(k5secret, 0, strlen(k5secret));
                 goto cleanup;
         }
       
                 goto cleanup;
         }
       
-        memset(k5secret, 0, sizeof(k5secret));      
+        memset(k5secret, 0, strlen(k5secret));
       }
 
       /* initialize the credentials cache and store the stuff we just got */
       }
 
       /* initialize the credentials cache and store the stuff we just got */