Bug #13641 Updated: Erroneous code makes PHP.EXE crash

From: Date: Fri, 12 Oct 2001 10:47:42 +0000
Subject: Bug #13641 Updated: Erroneous code makes PHP.EXE crash
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-67840@lists.php.net to get a copy of this message
ID: 13641 Updated by: sander Reported By: rune@strand.gs Status: Open Bug Type: Reproducible crash Operating System: Win32 (W2K) PHP Version: 4.0.6 New Comment: Reproduced with PHP-4.0.6 on Win98. You can even simplify the code: <?php strtok('foo'); ?> The problem is that you may not call strtok the first time without the second argument. If you do, it will crash, no matter what the first argument is. This should really be fixed before 4.0.7 comes out (if it's not already fixed in CVS, I can't test it right now). Previous Comments: ------------------------------------------------------------------------ [2001-10-11 06:48:32] derick@php.net FYI: I could not reproduce this with Linux/4.0.6. ------------------------------------------------------------------------ [2001-10-11 06:42:53] rune@strand.gs <code> <?php $str = "this is text"; $var = strtok($str); echo ?> </code> I know the code is wrong, but php.exe shouldn't crash. I've got the Standard binary distribution for Win32 running as CGI binary from the standard Apache binary distribution. W2K error message: "php-exe - Application Error The instruction at 0x1004cbb3" referenced memory at 0x5b0a0d0a". The memory could not be 'read'. Click OK to terminate the program" Sorry; no gdb backtrace... Thanks for doing great work! --rune ------------------------------------------------------------------------ Edit this bug report at http://bugs.php.net/?id=13641&edit=1

« previous php.dev (#67840) next »