[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: strerror() not thread-safe -- does it matter?
- From: Josh Haberman <jhaberman@...>
- Date: Fri, 23 Mar 2012 01:32:18 -0700
Lua uses strerror() in several places (lauxlib.c, liolib.c, luac.c),
but it is not thread-safe. On my system (OS X) strerror's static
buffer is initialized to all-NULL, and therefore guaranteed to be
NULL-terminated (even with racing writes), but are there systems where
a race could crash the program? An extremely low chance of an
incorrect/garbled message seems acceptable, but the potential for a
crash (or even a security exploit) seems bad.
Has this come up before?
Josh