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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 23:01:34 2024 UTC