php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58619 Trailing \x0a characters still included in string values.
Submitted: 2009-04-05 20:39 UTC Modified: 2009-04-06 03:54 UTC
From: sean at gothic dot net dot au Assigned: bhuisgen (profile)
Status: Closed Package: htscanner (PECL)
PHP Version: 5.2.9 OS: FreeBSD
Private report: No CVE-ID: None
 [2009-04-05 20:39 UTC] sean at gothic dot net dot au
Description:
------------
php_value include_path xxx:yyy:zzz ... the last entry isn't 
searched, as it's set as zzz\x0a as the trailing end of line 
is not stripped before storing. The end of line code check 
only checks for \r\n (well, not even that validly)






Reproduce code:
---------------
10:27 Mon 06-Apr root@visi [~gothweb/www/www.gothic.net.au] hd .htaccess
00000000  3c 49 66 4d 6f 64 75 6c  65 20 6d 6f 64 5f 70 68  |<IfModule mod_ph|
00000010  70 2e 63 3e 0a 20 20 70  68 70 5f 76 61 6c 75 65  |p.c>.  php_value|
00000020  20 69 6e 63 6c 75 64 65  5f 70 61 74 68 20 2e 3a  | include_path .:|
00000030  2f 75 73 72 2f 6c 6f 63  61 6c 2f 73 68 61 72 65  |/usr/local/share|
00000040  2f 70 65 61 72 3a 2f 68  6f 6d 65 2f 67 6f 74 68  |/pear:/home/goth|
00000050  77 65 62 2f 77 77 77 2f  77 77 77 2e 67 6f 74 68  |web/www/www.goth|
00000060  69 63 2e 6e 65 74 2e 61  75 2f 69 6e 63 6c 75 64  |ic.net.au/includ|
00000070  65 0a 20 20 70 68 70 5f  76 61 6c 75 65 20 64 65  |e.  php_value de|
00000080  66 61 75 6c 74 5f 63 68  61 72 73 65 74 20 69 73  |fault_charset is|
00000090  6f 2d 38 38 35 39 2d 31  0a 3c 2f 49 66 4d 6f 64  |o-8859-1.</IfMod|
000000a0  75 6c 65 3e 0a 0a 45 72  72 6f 72 44 6f 63 75 6d  |ule>..ErrorDocum|
000000b0  65 6e 74 20 34 30 34 20  2f 34 30 34 2e 70 68 70  |ent 404 /404.php|
000000c0  0a                                                |.|

Patch to fix: http://www.gothic.net.au/~sean/patch-htscanner.c

(Basically, adds checking for \n as well as \r)



Expected result:
----------------
well, the include path to work.






Actual result:
--------------
Warning: include() [function.include]: Failed opening 
'theme.php' for inclusion 
(include_path='.:/usr/local/share/pear:/home/gothweb/www/www.g
othic.net.au/include ') in 
/usr/home/gothweb/www/www.gothic.net.au/index.php on line 2





Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-04-06 03:54 UTC] bhuisgen at hbis dot fr
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.

This is the same bug as #16094, which is already fixed in CVS.
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Sun Sep 23 20:01:27 2018 UTC