php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #58452 wrong format string
Submitted: 2008-12-09 21:02 UTC Modified: 2008-12-10 05:12 UTC
From: crrodriguez at opensuse dot org Assigned: lstrojny (profile)
Status: Closed Package: mogilefs (PECL)
PHP Version: 5_2 CVS-2008-12-09 (dev) OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: crrodriguez at opensuse dot org
New email:
PHP Version: OS:

 

 [2008-12-09 21:02 UTC] crrodriguez at opensuse dot org
Description:
------------
in 

 PHP_METHOD(MogileFs, getDomains)
....


there is the following code

request_len = spprintf(&request, 0, "GET_DOMAINS\r\n", mogilefs_sock->domain);

did you mean

request_len = spprintf(&request, 0, "GET_DOMAINS\r\n"); 

peraphs..?

Compiler rightfully emits a warning.




Reproduce code:
---------------
---

Expected result:
----------------
Index: mogilefs.c
===================================================================
--- mogilefs.c.orig 2008-12-10 00:44:23.000000000 +0100
+++ mogilefs.c  2008-12-10 01:05:49.000000000 +0100
@@ -875,7 +875,7 @@ PHP_METHOD(MogileFs, getDomains)
    if (mogilefs_sock_get(object, &mogilefs_sock TSRMLS_CC) < 0) {
        RETURN_FALSE;
    }
-   request_len = spprintf(&request, 0, "GET_DOMAINS\r\n", mogilefs_sock->domain);
+   request_len = spprintf(&request, 0, "GET_DOMAINS\r\n");
    if (MOGILEFS_SOCK_WRITE_FREE(mogilefs_sock, request, request_len) < 0) {
        RETURN_FALSE;
    }


Actual result:
--------------
format string bug.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-10 05:12 UTC] lstrojny@php.net
This bug has been fixed in CVS.

In case this was a documentation problem, the fix will show up at the
end of next Sunday (CET) on pecl.php.net.

In case this was a pecl.php.net website problem, the change will show
up on the website in short time.
 
Thank you for the report, and for helping us make PECL better.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Feb 28 18:01:26 2020 UTC