Ticket #2039 (closed defect: fixed)

Opened 17 months ago

Last modified 17 months ago

Memory corruption caused by pj_sockaddr_parse()

Reported by: nanang Owned by: bennylp
Priority: normal Milestone: release-2.7
Component: pjlib Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no


pj_sockaddr_parse() is using pj_sockaddr_in_set_str_addr() which is using pj_gethostbyname() which is using gethostbyname() which is not reentrant. So pj_sockaddr_parse() is practically not thread-safe.

Thanks Pirmin Walthert for the investigation and the initial patch.

Change History

comment:1 Changed 17 months ago by nanang

  • Status changed from new to closed
  • Resolution set to fixed

In 5644:

Fix #2039: Updated pj_sockaddr_in_set_str_addr() to use pj_getaddrinfo() instead of pj_gethostbyname(), just as used by pj_sockaddr_set_str_addr() for IPv6 address resolution.

Note: See TracTickets for help on using tickets.