#2039 closed defect (fixed)

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

Description

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 (1)

comment:1 Changed 21 months ago by nanang

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

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.