sas             Mon Aug  2 04:27:24 2004 EDT

  Modified files:              
    /php-src/ext/session        mod_files.c 
  Log:
  don't read empty files
  
  0 malloc noticed by Antony Dovgal <[EMAIL PROTECTED]>
  
  
http://cvs.php.net/diff.php/php-src/ext/session/mod_files.c?r1=1.95&r2=1.96&ty=u
Index: php-src/ext/session/mod_files.c
diff -u php-src/ext/session/mod_files.c:1.95 php-src/ext/session/mod_files.c:1.96
--- php-src/ext/session/mod_files.c:1.95        Mon Mar 29 16:44:07 2004
+++ php-src/ext/session/mod_files.c     Mon Aug  2 04:27:24 2004
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: mod_files.c,v 1.95 2004/03/29 21:44:07 wez Exp $ */
+/* $Id: mod_files.c,v 1.96 2004/08/02 08:27:24 sas Exp $ */
 
 #include "php.h"
 
@@ -320,6 +320,12 @@
                return FAILURE;
        
        data->st_size = *vallen = sbuf.st_size;
+       
+       if (sbuf.st_size == 0) {
+               *val = STR_EMPTY_ALLOC();
+               return SUCCESS;
+       }
+       
        *val = emalloc(sbuf.st_size);
 
 #if defined(HAVE_PREAD)

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

Reply via email to