[Xapian-tickets] [Xapian] #665: Avoid C library functions not guaranteed to be thread-safe
Xapian
nobody at xapian.org
Tue May 7 05:18:26 BST 2024
#665: Avoid C library functions not guaranteed to be thread-safe
-------------------------+-------------------------------
Reporter: Olly Betts | Owner: Olly Betts
Type: defect | Status: assigned
Priority: highest | Milestone: 1.5.0
Component: Library API | Version: git master
Severity: normal | Resolution:
Keywords: | Blocked By:
Blocking: | Operating System: All
-------------------------+-------------------------------
Comment (by Olly Betts):
Checking POSIX, that makes fewer guarantees than the Linux man pages
https://pubs.opengroup.org/onlinepubs/9699919799/functions/getenv.html :
> The returned string pointer might be invalidated or the string content
might be overwritten by a subsequent call to `getenv()` [...]
So if the application is threaded and calls `getenv()` on another thread
concurrently with us calling `getenv()`, the string returned to us could
be invalidated or overwritten.
--
Ticket URL: <https://trac.xapian.org/ticket/665#comment:23>
Xapian <https://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list