summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/err/err.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/err/err.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/err/err.c')
-rw-r--r--src/lib/libcrypto/err/err.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/libcrypto/err/err.c b/src/lib/libcrypto/err/err.c
index ae9a209ad7..f6f9d2c080 100644
--- a/src/lib/libcrypto/err/err.c
+++ b/src/lib/libcrypto/err/err.c
@@ -603,8 +603,7 @@ static void build_SYS_str_reasons(void)
603 char *src = strerror(i); 603 char *src = strerror(i);
604 if (src != NULL) 604 if (src != NULL)
605 { 605 {
606 strncpy(*dest, src, sizeof *dest); 606 strlcpy(*dest, src, sizeof *dest);
607 (*dest)[sizeof *dest - 1] = '\0';
608 str->string = *dest; 607 str->string = *dest;
609 } 608 }
610 } 609 }