]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
chan_unistim: Fix memcpy in get_to_address 71/3071/2
authorGeorge Joseph <gjoseph@digium.com>
Wed, 22 Jun 2016 15:37:23 +0000 (09:37 -0600)
committerGeorge Joseph <gjoseph@digium.com>
Wed, 22 Jun 2016 18:28:58 +0000 (12:28 -0600)
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

channels/chan_unistim.c

index db4720d1a071adf34e046c4e52394fa115877928..c48f0f55dafafcb7b404dae5d2bf80685b78dc0d 100644 (file)
@@ -1021,7 +1021,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
 }