php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #8208 Weird behaviour
Submitted: 2000-12-12 10:33 UTC Modified: 2000-12-12 12:16 UTC
From: colin at easydns dot com Assigned:
Status: Closed Package: Sockets related
PHP Version: 4.0 Latest CVS (12/12/2000) OS: Redhat 6.2
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: colin at easydns dot com
New email:
PHP Version: OS:

 

 [2000-12-12 10:33 UTC] colin at easydns dot com
I tried the server code listed at http://www.php.net/manual/ref.sockets.php.  Everything seems to work except:

a) it spits back extra (whitespace) characters.  For instance, I connect and type "hi".  I get back:
        PHP: You said "hi"
        PHP: You said ""
This always happens, until I get stuck in a loop as above.


b) it spits back part of the code.  For instance, I changed the script to
        $talkback = "PHP: You said '" . urlencode($buf) . "'.\n";
I then get output like:
        PHP: You said 'foo%0D+%28true%29%3B%0A++++close+%28%24msgsock%29%3B%0A%7D+while+%28true%29%3B%0A%0Aclose+%28%24sock%29%3B%0A%3F%3E'.
        PHP: You said ''.
This only happens on the first line of input.   On the server side, I actually get the tail end of the PHP script output.


c) occasionally it gets stuck in a loop.  For instance, I connect and type "foo".  I get back:
        PHP: You said "f"
        PHP: You said "oo"
        PHP: You said "oo"
        PHP: You said "oo"
        ...etc.
This only seems to happen when I do the urlencode() testing above, and not until the 3rd or 4th line of input.


My knowledge is pretty limited, but might this be some kind of buffer overrun?

- Colin

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-12-12 12:16 UTC] stas@php.net
Should be fixed in CVS (except for "a", which is normal). If
not, please reopen.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 16:01:28 2024 UTC