]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_unistim: Fix memcpy in get_to_address 61/3261/2
authorGeorge Joseph <gjoseph@digium.com>
Wed, 22 Jun 2016 15:37:23 +0000 (09:37 -0600)
committerJoshua Colp <jcolp@digium.com>
Thu, 21 Jul 2016 12:34:41 +0000 (07:34 -0500)
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
(cherry picked from commit de169f14e6885934a0ebcdf7564eeb1e6fe99a21)

channels/chan_unistim.c

index cb786eb4dae6eb568db4b6a3816aaf8306ef86dd..125d5aa49f275479a5c2844c7507a0044d545bb3 100644 (file)
@@ -985,7 +985,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
 }