You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mongoose seems to call inet_ntoa from various places in worker threads.
inet_ntoa is documented in man pages as returning a pointer to a
statically-allocated buffer, so it may corrupt the buffer if two threads
(either two Mongoose threads, or Mongoose plus an application it's embedded in)
run it simultaneously.
(http://www.apsis.ch/pound/pound_list/archive/2006/2006-07/1151745756000
reports the kinds of errors this can lead to.)
In practice, at least recent versions of glibc use a per-thread buffer, and
MSDN says the buffer is valid until the next WinSock call on the same thread,
so they'll be safe, but other implementations might vary.
inet_ntop with a caller-allocated buffer looks like the right way to fix this.
Original issue reported on code.google.com by [email protected] on 23 Nov 2011 at 11:14
The text was updated successfully, but these errors were encountered:
Original issue reported on code.google.com by
[email protected]
on 23 Nov 2011 at 11:14The text was updated successfully, but these errors were encountered: