Date: Thu, 16 May 2019 09:03:48 +0000 (UTC) From: Michael Tuexen <tuexen@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r347664 - stable/11/lib/libc/net Message-ID: <201905160903.x4G93mbe034388@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: tuexen Date: Thu May 16 09:03:48 2019 New Revision: 347664 URL: https://svnweb.freebsd.org/changeset/base/347664 Log: MFC r344722: Use correct buffer sizes in sctp_get[lp]addrs(). Modified: stable/11/lib/libc/net/sctp_sys_calls.c Directory Properties: stable/11/ (props changed) Modified: stable/11/lib/libc/net/sctp_sys_calls.c ============================================================================== --- stable/11/lib/libc/net/sctp_sys_calls.c Thu May 16 09:02:30 2019 (r347663) +++ stable/11/lib/libc/net/sctp_sys_calls.c Thu May 16 09:03:48 2019 (r347664) @@ -413,7 +413,7 @@ sctp_getpaddrs(int sd, sctp_assoc_t id, struct sockadd return (-1); } /* size required is returned in 'asoc' */ - opt_len = (socklen_t) ((size_t)asoc + sizeof(struct sctp_getaddresses)); + opt_len = (socklen_t) ((size_t)asoc + sizeof(sctp_assoc_t)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM; @@ -473,9 +473,7 @@ sctp_getladdrs(int sd, sctp_assoc_t id, struct sockadd errno = ENOTCONN; return (-1); } - opt_len = (socklen_t) (size_of_addresses + - sizeof(struct sockaddr_storage) + - sizeof(struct sctp_getaddresses)); + opt_len = (socklen_t) (size_of_addresses + sizeof(sctp_assoc_t)); addrs = calloc(1, (size_t)opt_len); if (addrs == NULL) { errno = ENOMEM;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905160903.x4G93mbe034388>