File tree Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Expand file tree Collapse file tree 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 99 . "Connection: close" instead of "Connection: closed" (Gustavo)
1010
1111- Core:
12+ . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
1213 . Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
1314 (without apache2)). (Laruence)
1415 . Fixed bug #61605 (header_remove() does not remove all headers). (Laruence)
Original file line number Diff line number Diff line change @@ -266,6 +266,11 @@ PHP_FUNCTION(hex2bin)
266266 return ;
267267 }
268268
269+ if (datalen % 2 != 0 ) {
270+ php_error_docref (NULL TSRMLS_CC , E_WARNING , "Hexadecimal input string must have an even length" );
271+ RETURN_FALSE ;
272+ }
273+
269274 result = php_hex2bin ((unsigned char * )data , datalen , & newlen );
270275
271276 if (!result ) {
Original file line number Diff line number Diff line change 1+ --TEST--
2+ Bug #61660: bin2hex(hex2bin($data)) != $data
3+ --FILE--
4+ <?php
5+
6+ var_dump (hex2bin ('123 ' ));
7+
8+ ?>
9+ --EXPECTF--
10+ Warning: hex2bin(): Hexadecimal input string must have an even length in %s on line %d
11+ bool(false)
You can’t perform that action at this time.
0 commit comments