Bug #75810 [Opn->Fbk]: getenv with valid varname crashes ntdll.dll

From: Date: Fri, 12 Jan 2018 20:23:21 +0000
Subject: Bug #75810 [Opn->Fbk]: getenv with valid varname crashes ntdll.dll
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-213510@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=75810&edit=1 ID: 75810 Updated by: ab@php.net Reported by: laurinkeithdavis at gmail dot com Summary: getenv with valid varname crashes ntdll.dll -Status: Open +Status: Feedback Type: Bug Package: PHP options/info functions Operating System: Windows 10 x64 Pro PHP Version: 7.1.13 Block user comment: N Private report: N New Comment: Thanks for the report. Looks pretty much like bug #75794. What is your exact PHP. Please post your php.ini. If possible, also a crash dump. Thanks. Previous Comments: ------------------------------------------------------------------------ [2018-01-12 19:36:58] laurinkeithdavis at gmail dot com I'm pretty sure the change made for https://bugs.php.net/bug.php?id=75574 is the "cause", as getenv was modified, not just putenv. I don't know C well enough. I am trying to decipher the change that might be an issue, but no luck so far. ------------------------------------------------------------------------ [2018-01-12 19:14:42] laurinkeithdavis at gmail dot com Confirmed this does not occur in 7.1.12. ------------------------------------------------------------------------ [2018-01-12 19:12:42] laurinkeithdavis at gmail dot com Description: ------------ Any specific varname, if that environment variable name actually exists, crashes PHP. If you put a non-valid environment variable name, that does not crash and no value (getenv()), dumps the whole array, and does not crash. Test script: --------------- <?php echo getenv("PATH"); Expected result: ---------------- Value of the indicated environment variable. Actual result: -------------- Internal Server Error 500 AND Log Name: Application Source: Application Error Date: 1/12/2018 12:46:03 PM Event ID: 1000 Task Category: (100) Level: Error Keywords: Classic User: N/A Computer: KDAVIS.pridedallas.com Description: Faulting application name: php-cgi.exe, version: 7.1.13.0, time stamp: 0x5a4d3a49 Faulting module name: ntdll.dll, version: 10.0.16299.192, time stamp: 0x16e7ff7f Exception code: 0xc0000374 Fault offset: 0x000da8b9 Faulting process id: 0x1ecc Faulting application start time: 0x01d38bd593ca174a Faulting application path: C:\PHP\php-cgi.exe Faulting module path: C:\WINDOWS\SYSTEM32\ntdll.dll Report Id: c4b5c9e2-dcb6-4f21-9b32-457689bce66a Faulting package full name: Faulting package-relative application ID: ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=75810&edit=1

« previous php.bugs (#213510) next »