X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=cmdline.c;h=a4c91601079e1b461007fe22a03edf08dfcaa3d5;hb=37ea0f45414fe01250de8485ed9f4c390057861c;hp=9c873503d15913964ff5ab862e837ba6520cfeba;hpb=62cbc7dc0b33808dc8794c59f60971fbba97894b;p=PuTTY.git diff --git a/cmdline.c b/cmdline.c index 9c873503..a4c91601 100644 --- a/cmdline.c +++ b/cmdline.c @@ -63,7 +63,7 @@ void cmdline_cleanup(void) int pri; if (cmdline_password) { - memset(cmdline_password, 0, strlen(cmdline_password)); + smemclr(cmdline_password, strlen(cmdline_password)); sfree(cmdline_password); cmdline_password = NULL; } @@ -105,15 +105,12 @@ int cmdline_get_passwd_input(prompts_t *p, unsigned char *in, int inlen) { if (tried_once) return 0; - strncpy(p->prompts[0]->result, cmdline_password, - p->prompts[0]->result_len); - p->prompts[0]->result[p->prompts[0]->result_len-1] = '\0'; - memset(cmdline_password, 0, strlen(cmdline_password)); + prompt_set_result(p->prompts[0], cmdline_password); + smemclr(cmdline_password, strlen(cmdline_password)); sfree(cmdline_password); cmdline_password = NULL; tried_once = 1; return 1; - } /* @@ -371,7 +368,7 @@ int cmdline_process_param(char *p, char *value, int need_save, Conf *conf) /* Assuming that `value' is directly from argv, make a good faith * attempt to trample it, to stop it showing up in `ps' output * on Unix-like systems. Not guaranteed, of course. */ - memset(value, 0, strlen(value)); + smemclr(value, strlen(value)); } }