[php-src] PR #16995: Fix potential OOB read in zend_dirname() on Windows
| From: | cmb69 | Date: | Fri, 29 Nov 2024 17:14:14 +0000 |
| Subject: | [php-src] PR #16995: Fix potential OOB read in zend_dirname() on Windows | ||
| Groups: | php.git-pulls | ||
| Request: | Send a blank email to git-pulls+get-29835@lists.php.net to get a copy of this message | ||
Pull Request: https://github.com/php/php-src/pull/16995
Author: cmb69
Only on Windows
IS_SLASH_P() may read the previous byte, and so may in unlikely cases
read one byte out of bounds. Since IS_SLASH_P() is in a public header (albeit not
likely to be used by external extensions or SAPIs), we introduce IS_SLASH_P_EX() which
accepts a second argument to prevent that OOB read.
It should be noted that the PHP userland function dirname() is not affected by this
issue, since it does not call zend_dirname() on Windows.