Download src/php/php-src/Zend/tests/backtrace/bug76047.phpt from meddyrat/dis-bench: direct link, hf CLI and curl.
- Browser
- Download file 1.1 kB
-
https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/backtrace/bug76047.phpt
- Command line
-
hf download hf://datasets/meddyrat/dis-bench/src/php/php-src/Zend/tests/backtrace/bug76047.phpt
-
curl -L -o bug76047.phpt https://huggingface.co/datasets/meddyrat/dis-bench/resolve/main/src/php/php-src/Zend/tests/backtrace/bug76047.phpt
1.1 kB
| --TEST-- | |
| Bug #76047: Use-after-free when accessing already destructed backtrace arguments | |
| --FILE-- | |
| class Vuln { | |
| public $a; | |
| public function __destruct() { | |
| unset($this->a); | |
| $backtrace = (new Exception)->getTrace(); | |
| var_dump($backtrace); | |
| } | |
| } | |
| function test($arg) { | |
| $arg = str_shuffle(str_repeat('A', 79)); | |
| $vuln = new Vuln(); | |
| $vuln->a = $arg; | |
| } | |
| function test2($arg) { | |
| $$arg = 1; // Trigger symbol table | |
| $arg = str_shuffle(str_repeat('A', 79)); | |
| $vuln = new Vuln(); | |
| $vuln->a = $arg; | |
| } | |
| test('x'); | |
| test2('x'); | |
| --EXPECTF-- | |
| array(1) { | |
| [0]=> | |
| array(6) { | |
| ["file"]=> | |
| string(%d) "%s" | |
| ["line"]=> | |
| int(%d) | |
| ["function"]=> | |
| string(10) "__destruct" | |
| ["class"]=> | |
| string(4) "Vuln" | |
| ["type"]=> | |
| string(2) "->" | |
| ["args"]=> | |
| array(0) { | |
| } | |
| } | |
| } | |
| array(1) { | |
| [0]=> | |
| array(6) { | |
| ["file"]=> | |
| string(%d) "%s" | |
| ["line"]=> | |
| int(%d) | |
| ["function"]=> | |
| string(10) "__destruct" | |
| ["class"]=> | |
| string(4) "Vuln" | |
| ["type"]=> | |
| string(2) "->" | |
| ["args"]=> | |
| array(0) { | |
| } | |
| } | |
| } | |