Increase internal security when using strncpy, by making sure the resulting string is NUL-terminated

This commit is contained in:
Richard Levitte
2002-02-28 12:42:19 +00:00
parent 5c62f68e14
commit 26414ee013
6 changed files with 18 additions and 4 deletions

View File

@@ -71,7 +71,10 @@ void EVP_set_pw_prompt(char *prompt)
if (prompt == NULL)
prompt_string[0]='\0';
else
{
strncpy(prompt_string,prompt,79);
prompt_string[79]='\0';
}
}
char *EVP_get_pw_prompt(void)