iliaa           Thu Nov 13 18:21:54 2008 UTC

  Modified files:              
    /php-src/ext/dba/libinifile inifile.c 
  Log:
  
  MFB: Fixed a bug inside dba_replace() that could cause file truncation with
  invalid keys
  
http://cvs.php.net/viewvc.cgi/php-src/ext/dba/libinifile/inifile.c?r1=1.21&r2=1.22&diff_format=u
Index: php-src/ext/dba/libinifile/inifile.c
diff -u php-src/ext/dba/libinifile/inifile.c:1.21 
php-src/ext/dba/libinifile/inifile.c:1.22
--- php-src/ext/dba/libinifile/inifile.c:1.21   Mon Dec 31 07:12:08 2007
+++ php-src/ext/dba/libinifile/inifile.c        Thu Nov 13 18:21:54 2008
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: inifile.c,v 1.21 2007/12/31 07:12:08 sebastian Exp $ */
+/* $Id: inifile.c,v 1.22 2008/11/13 18:21:54 iliaa Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -42,7 +42,7 @@
 /* {{{ inifile_version */
 char *inifile_version() 
 {
-       return "1.0, $Revision: 1.21 $";
+       return "1.0, $Revision: 1.22 $";
 }
 /* }}} */ 
 
@@ -507,7 +507,9 @@
        
        /* 5 */
        if (ret == SUCCESS) {
-               ret = inifile_truncate(dba, append ? pos_grp_next : 
pos_grp_start TSRMLS_CC); /* writes error on fail */
+               if (!value || (key->name && strlen(key->name))) {
+                       ret = inifile_truncate(dba, append ? pos_grp_next : 
pos_grp_start TSRMLS_CC); /* writes error on fail */
+               }
        }
 
        if (ret == SUCCESS) {



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

Reply via email to