PHP 4.0 Bug #8208: Weird behaviour

From: Date: Tue, 12 Dec 2000 15:33:39 +0000
Subject: PHP 4.0 Bug #8208: Weird behaviour
Groups: php.dev 
Request: Send a blank email to php-dev+get-40975@lists.php.net to get a copy of this message
From: colin@easydns.com Operating system: Redhat 6.2 PHP version: 4.0 Latest CVS (12/12/2000) PHP Bug Type: Sockets related Bug description: Weird behaviour 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 -- Edit Bug report at: http://bugs.php.net/?id=8208&edit=1

« previous php.dev (#40975) next »