tony2001                Mon Dec 18 13:16:54 2006 UTC

  Modified files:              (Branch: PHP_5_2)
    /php-src/main       SAPI.c 
  Log:
  MFH: fix possible invalid read (reproducible only on big-endian machines)
  
  
http://cvs.php.net/viewvc.cgi/php-src/main/SAPI.c?r1=1.202.2.7.2.3&r2=1.202.2.7.2.4&diff_format=u
Index: php-src/main/SAPI.c
diff -u php-src/main/SAPI.c:1.202.2.7.2.3 php-src/main/SAPI.c:1.202.2.7.2.4
--- php-src/main/SAPI.c:1.202.2.7.2.3   Mon Dec 18 12:32:08 2006
+++ php-src/main/SAPI.c Mon Dec 18 13:16:54 2006
@@ -18,7 +18,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: SAPI.c,v 1.202.2.7.2.3 2006/12/18 12:32:08 zeev Exp $ */
+/* $Id: SAPI.c,v 1.202.2.7.2.4 2006/12/18 13:16:54 tony2001 Exp $ */
 
 #include <ctype.h>
 #include <sys/stat.h>
@@ -565,7 +565,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