Hello Ilia,

Thursday, November 13, 2008, 7:21:40 PM, you wrote:

> iliaa           Thu Nov 13 18:21:40 2008 UTC

>   Modified files:              (Branch: PHP_5_3)
>     /php-src/ext/dba/libinifile       inifile.c 
>   Log:
>   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.14.2.1.2.3.2.1&r2=1.14.2.1.2.3.2.2&diff_format=u
> Index: php-src/ext/dba/libinifile/inifile.c
> diff -u php-src/ext/dba/libinifile/inifile.c:1.14.2.1.2.3.2.1
> php-src/ext/dba/libinifile/inifile.c:1.14.2.1.2.3.2.2
> --- php-src/ext/dba/libinifile/inifile.c:1.14.2.1.2.3.2.1       Mon Dec 31 
> 07:17:07 2007
> +++ php-src/ext/dba/libinifile/inifile.c        Thu Nov 13 18:21:40 2008
> @@ -16,7 +16,7 @@
>    
> +----------------------------------------------------------------------+
>   */
>  
> -/* $Id: inifile.c,v 1.14.2.1.2.3.2.1 2007/12/31 07:17:07 sebastian Exp $ */
> +/* $Id: inifile.c,v 1.14.2.1.2.3.2.2 2008/11/13 18:21:40 iliaa Exp $ */
>  
>  #ifdef HAVE_CONFIG_H
>  #include "config.h"
> @@ -43,7 +43,7 @@
>  /* {{{ inifile_version */
>  char *inifile_version() 
>  {
> -       return "1.0, $Revision: 1.14.2.1.2.3.2.1 $";
> +       return "1.0, $Revision: 1.14.2.1.2.3.2.2 $";
>  }
>  /* }}} */ 
>  
> @@ -508,7 +508,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))) {

Why strlen here? Doing (key->name && *key->name) would be enough.

> +                       ret = inifile_truncate(dba, append ?
> pos_grp_next : pos_grp_start TSRMLS_CC); /* writes error on fail */
> +               }
>         }
>  
>         if (ret == SUCCESS) {






Best regards,
 Marcus


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

Reply via email to