Possible memory corruption in in pj_sockaddr_set_str_addr() with IPv6 address

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

When using pj_sockaddr_set_str_addr() in sock_common.c with an IPv6 
address, the stack seems to be corrupted by pj_memcpy().
The original code (up to pjlib version 2.1) is:
                 pj_memcpy(&addr->ipv6.sin6_addr, 
&ai.ai_addr.ipv6.sin6_addr, sizeof(*pj_sockaddr_in6*));
I would like to suggest to change it to:
                 pj_memcpy(&addr->ipv6.sin6_addr, 
&ai.ai_addr.ipv6.sin6_addr, sizeof(*addr->ipv6.sin6_addr*));
because &addr->ipv6.sin6_addr is a pointer to a *pj_in6_addr *structure.

Any comment is welcome.

Pascal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.pjsip.org/pipermail/pjsip_lists.pjsip.org/attachments/20130606/2b0292ed/attachment-0001.html>


[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux