Fix clearing password in memory
authorJacob Welsh <jwelsh@sinenomine.net>
Sat, 13 Dec 2014 03:33:36 +0000 (22:33 -0500)
committerJacob Welsh <jwelsh@sinenomine.net>
Sat, 13 Dec 2014 03:34:33 +0000 (22:34 -0500)
Caught by new GCC warning -Wsizeof-pointer-memaccess

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 */
-                  memset(k5secret, 0, sizeof(k5secret));               
+                  memset(k5secret, 0, strlen(k5secret));
                 goto cleanup;
         }
       
-        memset(k5secret, 0, sizeof(k5secret));      
+        memset(k5secret, 0, strlen(k5secret));
       }
 
       /* initialize the credentials cache and store the stuff we just got */