|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-11-24 17:29 UTC] wharmby at uk dot ibm dot com
Description: ------------ The implementation of putenv() in standard/basic_function.c uses the C library function strtok(). Whilst this is OK when compiling with Microsoft Visual C because PHP is linked with the Mutithreaded C run-time library (/MD or /MDd option) whether ZTS is enabled or not, the gcc version of strtok() is not thread safe and a separate function strtok_r() is provided should thread safety be required. Easily resolved without the need for #if def's in code by changing code to call the php function php_strtok_r() as a number of other extensions already do. Patch to fix the code is here: http://pastebin.ca/256777 Reproduce code: --------------- Problem found by code inspection. As with most thread safety issues difficult to produce a simple testcase which will show a reproducible crash but current Linux executable is clearly not reentrant. Expected result: ---------------- N/A Actual result: -------------- N/A PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 07:00:01 2025 UTC |
Sorry uploaded wrong version of patch above. Here is correct patch: http://pastebin.ca/257571