From: George Joseph Date: Wed, 22 Jun 2016 15:37:23 +0000 (-0600) Subject: chan_unistim: Fix memcpy in get_to_address X-Git-Tag: 11.23.0-rc1~6^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fchanges%2F73%2F3073%2F2;p=thirdparty%2Fasterisk.git chan_unistim: Fix memcpy in get_to_address A code block only enabled when HAVE_PKTINFO is not defined (FreeBSD) was using a pointer to a pointer as the destination of a memcpy and a '&' instead of '*' in the sizeof. ASTERISK-26138 #close Change-Id: Id4927ff256c0e470bdf7bcfc025146a2f656e708 --- diff --git a/channels/chan_unistim.c b/channels/chan_unistim.c index a5cbdf24be..4b3b0f9e5f 100644 --- a/channels/chan_unistim.c +++ b/channels/chan_unistim.c @@ -984,7 +984,7 @@ static int get_to_address(int fd, struct sockaddr_in *toAddr) memcpy(&toAddr->sin_addr, &ip_msg.address, sizeof(struct in_addr)); return err; #else - memcpy(&toAddr, &public_ip, sizeof(&toAddr)); + memcpy(toAddr, &public_ip, sizeof(*toAddr)); return 0; #endif }