mirror of
https://github.com/php/php-src.git
synced 2025-08-15 21:48:51 +02:00
- Fix handling of zero'th argument for sprintf()'s argument swapping code
(Patch by Morten Poulsen <morten@afdelingp.dk>)
This commit is contained in:
parent
c7bee30374
commit
25b42ae3b6
1 changed files with 8 additions and 0 deletions
|
@ -480,6 +480,14 @@ php_formatted_print(int ht, int *len, int use_array TSRMLS_DC)
|
|||
while (isdigit((int)format[temppos])) temppos++;
|
||||
if (format[temppos] == '$') {
|
||||
argnum = php_sprintf_getnumber(format, &inpos);
|
||||
|
||||
if (argnum == 0) {
|
||||
efree(result);
|
||||
efree(args);
|
||||
php_error(E_WARNING, "%s(): zero is not a valid argument number", get_active_function_name(TSRMLS_C));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
inpos++; /* skip the '$' */
|
||||
} else {
|
||||
argnum = currarg++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue