Bug #68905 [Opn->Nab]: Incorrect printf

From: Date: Tue, 27 Jan 2015 13:27:29 +0000
Subject: Bug #68905 [Opn->Nab]: Incorrect printf
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-190247@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68905&edit=1 ID: 68905 Updated by: johannes@php.net Reported by: bugreports at internot dot info Summary: Incorrect printf -Status: Open +Status: Not a bug Type: Bug Package: *General Issues Operating System: Linux Ubuntu 14.04 PHP Version: 5.5.21 Block user comment: N Private report: N New Comment: The * in the format indicates that a precision is provided. Thus the code is correct. See spprintf implementation: http://lxr.php.net/xref/PHP_TRUNK/main/spprintf.c#306 Previous Comments: ------------------------------------------------------------------------ [2015-01-24 19:31:03] bugreports at internot dot info Same in /ext/pdo/pdo_stmt.c: int len = spprintf(&p, 0, "%.*H", (int) EG(precision), Z_DVAL_P(param->parameter)); and in /ext/json/json.c: len = spprintf(&d, 0, "%.*k", (int) EG(precision), dbl); and int l = spprintf(&tmp, 0, "%.*k", (int) EG(precision), d); ------------------------------------------------------------------------ [2015-01-24 19:29:37] bugreports at internot dot info Description: ------------ Hi, In /ext/standard/var.c: 439 tmp_len = spprintf(&tmp_str, 0,"%.*H", PG(serialize_precision), Z_DVAL_PP(struc)); This is wrong on two levels: the mismatch of arguments(2, instead of 1), and the invalid conversion. Thanks ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=68905&edit=1

« previous php.bugs (#190247) next »