tony2001                Mon Dec 18 13:15:18 2006 UTC

  Modified files:              
    /php-src/main       SAPI.c 
  Log:
  fix possible invalid read (reproducible only on big-endian machines)
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/SAPI.c?r1=1.217&r2=1.218&diff_format=u
Index: php-src/main/SAPI.c
diff -u php-src/main/SAPI.c:1.217 php-src/main/SAPI.c:1.218
--- php-src/main/SAPI.c:1.217   Wed Aug 30 12:25:56 2006
+++ php-src/main/SAPI.c Mon Dec 18 13:15:18 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: SAPI.c,v 1.217 2006/08/30 12:25:56 mike Exp $ */
+/* $Id: SAPI.c,v 1.218 2006/12/18 13:15:18 tony2001 Exp $ */
 
 #include <ctype.h>
 #include <sys/stat.h>
@@ -591,7 +591,7 @@
        header_line = estrndup(header_line, header_line_len);
 
        /* cut of trailing spaces, linefeeds and carriage-returns */
-       while(isspace(header_line[header_line_len-1])) 
+       while(header_line_len && isspace(header_line[header_line_len-1])) 
                  header_line[--header_line_len]='\0';
        
        /* new line safety check */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to