artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
783b477
)
malloc + strlcpy -> strdup
author
deraadt
<deraadt@openbsd.org>
Sat, 19 Apr 2014 12:36:03 +0000
(12:36 +0000)
committer
deraadt
<deraadt@openbsd.org>
Sat, 19 Apr 2014 12:36:03 +0000
(12:36 +0000)
lib/libssl/src/apps/s_socket.c
patch
|
blob
|
history
diff --git
a/lib/libssl/src/apps/s_socket.c
b/lib/libssl/src/apps/s_socket.c
index
57015ed
..
d52714c
100644
(file)
--- a/
lib/libssl/src/apps/s_socket.c
+++ b/
lib/libssl/src/apps/s_socket.c
@@
-302,11
+302,10
@@
redoit:
*host = NULL;
/* return(0); */
} else {
- if ((*host =
(char *) malloc(strlen(h1->h_name) + 1)
) == NULL) {
- perror("
malloc
");
+ if ((*host =
strdup(h1->h_name
) == NULL) {
+ perror("
strdup
");
return (0);
}
- strlcpy(*host, h1->h_name, strlen(h1->h_name) + 1);
h2 = GetHostByName(*host);
if (h2 == NULL) {