xref: /PHP-7.3/ext/standard/tests/file/bug79099.phpt (revision 0f79b1bf)
1--TEST--
2Bug #79099 (OOB read in php_strip_tags_ex)
3--FILE--
4<?php
5$stream = fopen('php://memory', 'w+');
6fputs($stream, "<?\n\"\n");
7rewind($stream);
8var_dump(@fgetss($stream));
9var_dump(@fgetss($stream));
10fclose($stream);
11
12$stream = fopen('php://memory', 'w+');
13fputs($stream, "<\0\n!\n");
14rewind($stream);
15var_dump(@fgetss($stream));
16var_dump(@fgetss($stream));
17fclose($stream);
18
19$stream = fopen('php://memory', 'w+');
20fputs($stream, "<\0\n?\n");
21rewind($stream);
22var_dump(@fgetss($stream));
23var_dump(@fgetss($stream));
24fclose($stream);
25?>
26--EXPECT--
27string(0) ""
28string(0) ""
29string(0) ""
30string(0) ""
31string(0) ""
32string(0) ""
33