summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/evp/evp_key.c
diff options
context:
space:
mode:
authorbeck <>2014-04-16 20:36:35 +0000
committerbeck <>2014-04-16 20:36:35 +0000
commit750d86a4fc04f53024575d65269281ea6c4e450c (patch)
tree4a8d2bd6f2dd786d658a75ea2db858806f2ec5f4 /src/lib/libcrypto/evp/evp_key.c
parentbe77aa550ef0450b00eb62880d4d98112ba86e50 (diff)
downloadopenbsd-750d86a4fc04f53024575d65269281ea6c4e450c.tar.gz
openbsd-750d86a4fc04f53024575d65269281ea6c4e450c.tar.bz2
openbsd-750d86a4fc04f53024575d65269281ea6c4e450c.zip
Clean up dangerous strncpy use. This included a use where the resulting
string was potentially not nul terminated and a place where malloc return was unchecked. while we're at it remove dummytest.c ok miod@
Diffstat (limited to 'src/lib/libcrypto/evp/evp_key.c')
-rw-r--r--src/lib/libcrypto/evp/evp_key.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/libcrypto/evp/evp_key.c b/src/lib/libcrypto/evp/evp_key.c
index 7961fbebf2..b3cb0638fa 100644
--- a/src/lib/libcrypto/evp/evp_key.c
+++ b/src/lib/libcrypto/evp/evp_key.c
@@ -72,8 +72,7 @@ void EVP_set_pw_prompt(const char *prompt)
72 prompt_string[0]='\0'; 72 prompt_string[0]='\0';
73 else 73 else
74 { 74 {
75 strncpy(prompt_string,prompt,79); 75 strlcpy(prompt_string,prompt,sizeof(prompt_string));
76 prompt_string[79]='\0';
77 } 76 }
78 } 77 }
79 78