diff options
author | hrs <hrs@FreeBSD.org> | 2013-07-12 06:54:29 +0000 |
---|---|---|
committer | hrs <hrs@FreeBSD.org> | 2013-07-12 06:54:29 +0000 |
commit | f8272818b4fd71ae139041d1e63e2406105668d0 (patch) | |
tree | 4e696153d5cb46c01480c720be7b3e4a88e71e38 | |
parent | e5c75edd62eb00cf58d339ad18419c62cb045ef5 (diff) | |
download | FreeBSD-src-f8272818b4fd71ae139041d1e63e2406105668d0.zip FreeBSD-src-f8272818b4fd71ae139041d1e63e2406105668d0.tar.gz |
Fix a wrong memcpy of struct sockaddr.
Spotted by: dt71@gmx.com
-rw-r--r-- | usr.sbin/ypserv/yp_main.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/usr.sbin/ypserv/yp_main.c b/usr.sbin/ypserv/yp_main.c index 60bd6a1..958d3a6 100644 --- a/usr.sbin/ypserv/yp_main.c +++ b/usr.sbin/ypserv/yp_main.c @@ -329,9 +329,8 @@ create_service(const int sock, const struct netconfig *nconf, return -1; } memset(slep, 0, sizeof(*slep)); - memcpy(&slep->sle_ss, - (struct sockaddr *)(res->ai_addr), - sizeof(res->ai_addr)); + memcpy(&slep->sle_ss, res->ai_addr, + res->ai_addrlen); slep->sle_sock = s; SLIST_INSERT_HEAD(&sle_head, slep, sle_next); |