File tree 3 files changed +17
-0
lines changed 3 files changed +17
-0
lines changed Original file line number Diff line number Diff line change 9
9
. "Connection: close" instead of "Connection: closed" (Gustavo)
10
10
11
11
- Core:
12
+ . Fixed bug #61660 (bin2hex(hex2bin($data)) != $data). (Nikita Popov)
12
13
. Fixed bug #61650 (ini parser crashes when using ${xxxx} ini variables
13
14
(without apache2)). (Laruence)
14
15
. 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)
266
266
return ;
267
267
}
268
268
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
+
269
274
result = php_hex2bin ((unsigned char * )data , datalen , & newlen );
270
275
271
276
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