Bug #68274 [Opn]: vsprintf miscounts argument count

From: Date: Tue, 21 Oct 2014 14:34:32 +0000
Subject: Bug #68274 [Opn]: vsprintf miscounts argument count
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188227@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=68274&edit=1

 ID:                 68274
 User updated by:    eep at mailinator dot com
 Reported by:        eep at mailinator dot com
 Summary:            vsprintf miscounts argument count
 Status:             Open
 Type:               Bug
 Package:            Unknown/Other Function
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

I just realized the provided test script is bad, since second parameter is not optional.

However, even with some parameters, the argument count is still counted wrong.

printf('%s (foo %) bar', 'test');

..produces the same warning.


Previous Comments:
------------------------------------------------------------------------
[2014-10-21 13:55:43] eep at mailinator dot com

Description:
------------
vsprintf() doesn't validate formatting strings, seems to only count percent signs (followed by
pretty much anything). For example, '%)' expects one parameter.

Test script:
---------------
<?php

vsprintf('(foo %) bar');

Actual result:
--------------
Warning: Wrong parameter count for vsprintf() in /vsprintf.php on line 2


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=68274&edit=1


Thread (1 message)

  • eep at mailinator dot com
  • Unknown Message
    • eep at mailinator dot com
« previous php.bugs (#188227) next »