mirror of
https://github.com/php/php-src.git
synced 2025-08-19 08:49:28 +02:00
- Fixed bug #50363 (Invalid parsing in convert.quoted-printable-decode filter)
Patch by: slusarz at curecanti dot org
This commit is contained in:
parent
35c42425fa
commit
4bf9334a82
3 changed files with 22 additions and 7 deletions
2
NEWS
2
NEWS
|
@ -40,6 +40,8 @@ PHP NEWS
|
||||||
. Fixed bug #54866 (incorrect accounting for realpath_cache_size) (Dustin Ward)
|
. Fixed bug #54866 (incorrect accounting for realpath_cache_size) (Dustin Ward)
|
||||||
. Fixed bug #54721 (Different Hashes on Windows, BSD and Linux on wrong Salt size)
|
. Fixed bug #54721 (Different Hashes on Windows, BSD and Linux on wrong Salt size)
|
||||||
(Pierre, os at irj dot ru)
|
(Pierre, os at irj dot ru)
|
||||||
|
. Fixed bug #50363 (Invalid parsing in convert.quoted-printable-decode filter).
|
||||||
|
(slusarz at curecanti dot org)
|
||||||
|
|
||||||
- Apache2 Handler SAPI:
|
- Apache2 Handler SAPI:
|
||||||
. Fixed bug #54529 (SAPI crashes on apache_config.c:197).
|
. Fixed bug #54529 (SAPI crashes on apache_config.c:197).
|
||||||
|
|
|
@ -1051,19 +1051,15 @@ static php_conv_err_t php_conv_qprint_decode_convert(php_conv_qprint_decode *ins
|
||||||
} /* break is missing intentionally */
|
} /* break is missing intentionally */
|
||||||
|
|
||||||
case 2: {
|
case 2: {
|
||||||
unsigned int nbl;
|
|
||||||
|
|
||||||
if (icnt <= 0) {
|
if (icnt <= 0) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
nbl = (*ps >= 'A' ? *ps - 0x37 : *ps - 0x30);
|
|
||||||
|
|
||||||
if (nbl > 15) {
|
if (!isxdigit((int) *ps)) {
|
||||||
err = PHP_CONV_ERR_INVALID_SEQ;
|
err = PHP_CONV_ERR_INVALID_SEQ;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
next_char = (next_char << 4) | nbl;
|
next_char = (next_char << 4) | (*ps >= 'A' ? *ps - 0x37 : *ps - 0x30);
|
||||||
|
|
||||||
scan_stat++;
|
scan_stat++;
|
||||||
ps++, icnt--;
|
ps++, icnt--;
|
||||||
if (scan_stat != 3) {
|
if (scan_stat != 3) {
|
||||||
|
|
17
ext/standard/tests/filters/bug50363.phpt
Normal file
17
ext/standard/tests/filters/bug50363.phpt
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
--TEST--
|
||||||
|
Bug #50363 (Invalid parsing in convert.quoted-printable-decode filter)
|
||||||
|
--FILE--
|
||||||
|
<?php
|
||||||
|
|
||||||
|
$foo = "Sauvegarder=C3=A9ussi(e) n=C3=A3o N=C3=83O\n";
|
||||||
|
$foo .= "Sauvegarder=c3=a9ussi(e) n=c3=a3o N=c3=83O\n"; // Does not work!
|
||||||
|
$b = fopen('php://temp', 'w+');
|
||||||
|
stream_filter_append($b, 'convert.quoted-printable-decode', STREAM_FILTER_WRITE);
|
||||||
|
fwrite($b, $foo);
|
||||||
|
rewind($b);
|
||||||
|
fpassthru($b);
|
||||||
|
|
||||||
|
?>
|
||||||
|
--EXPECTF--
|
||||||
|
Sauvegarderéussi(e) não NÃO
|
||||||
|
Sauvegarderéussi(e) não NÃO
|
Loading…
Add table
Add a link
Reference in a new issue