cvs: php-src(PHP_5_0) / NEWS /ext/standard formatted_print.c

From: Date: Wed, 26 Jan 2005 00:02:46 +0000
Subject: cvs: php-src(PHP_5_0) / NEWS /ext/standard formatted_print.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-30157@lists.php.net to get a copy of this message
iliaa Tue Jan 25 19:02:46 2005 EDT Modified files: (Branch: PHP_5_0) /php-src NEWS /php-src/ext/standard formatted_print.c Log: Fixed bug #29733 (printf() handles repeated placeholders wrong). (bugs dot php dot net at bluetwanger dot de, Ilia) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.216&r2=1.1760.2.217&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.216 php-src/NEWS:1.1760.2.217 --- php-src/NEWS:1.1760.2.216 Tue Jan 25 18:43:10 2005 +++ php-src/NEWS Tue Jan 25 19:02:45 2005 @@ -59,6 +59,8 @@ in segfault). (pdan-php at esync dot org, Tony) - Fixed bug #30120 (imagettftext() and imagettfbbox() accept too many parameters). (Jani) +- Fixed bug #29733 (printf() handles repeated placeholders wrong). + (bugs dot php dot net at bluetwanger dot de, Ilia) - Fixed bug #29136 (make test - libtool failure on MacOSX). (Jani) - Fixed bug #28976 (mail(): use "From:" from headers if sendmail_from is empty). (Jani) http://cvs.php.net/diff.php/php-src/ext/standard/formatted_print.c?r1=1.77.2.3&r2=1.77.2.4&ty=u Index: php-src/ext/standard/formatted_print.c diff -u php-src/ext/standard/formatted_print.c:1.77.2.3 php-src/ext/standard/formatted_print.c:1.77.2.4 --- php-src/ext/standard/formatted_print.c:1.77.2.3 Mon Nov 15 08:41:41 2004 +++ php-src/ext/standard/formatted_print.c Tue Jan 25 19:02:46 2005 @@ -16,7 +16,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: formatted_print.c,v 1.77.2.3 2004/11/15 13:41:41 derick Exp $ */ +/* $Id: formatted_print.c,v 1.77.2.4 2005/01/26 00:02:46 iliaa Exp $ */ #include <math.h> /* modf() */ #include "php.h" @@ -545,12 +545,6 @@ php_sprintf_appendchar(&result, &outpos, &size, '%' TSRMLS_CC); inpos += 2; } else { - if (currarg >= argc && format[inpos + 1] != '%') { - efree(result); - efree(args); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments"); - return NULL; - } /* starting a new format specifier, reset variables */ alignment = ALIGN_RIGHT; adjusting = 0; @@ -581,13 +575,6 @@ } argnum += format_offset; - - if (argnum >= argc) { - efree(result); - efree(args); - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments"); - return NULL; - } /* after argnum comes modifiers */ PRINTF_DEBUG(("sprintf: looking for modifiers\n" @@ -643,6 +630,13 @@ argnum = currarg++ + format_offset; } + if (argnum >= argc) { + efree(result); + efree(args); + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Too few arguments"); + return NULL; + } + if (format[inpos] == 'l') { inpos++; }

« previous php.cvs (#30157) next »