php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #59861 segmentfault call the fetch method
Submitted: 2011-07-20 05:31 UTC Modified: 2011-07-21 16:30 UTC
From: iammutex at gmail dot com Assigned:
Status: Closed Package: oauth (PECL)
PHP Version: 5.3.4 OS: linux
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: iammutex at gmail dot com
New email:
PHP Version: OS:

 

 [2011-07-20 05:31 UTC] iammutex at gmail dot com
Description:
------------
While the method 'fetch' was called without the '$http_method' 
parameter.there while be an segmentfault.

REASON:

The *OAUTH_OVERRIDE_HTTP_METHOD* was added to the 
*oauth_fetch* function's parameter, so the pointer 
*final_http_method* was given the value of *method*(It is NULL 
while you dont pass the $http_method parameter)(l.1573).

Then the "strcmp"(l.1699) while trigger a segmentfault error.

Reproduce code:
---------------
...
2598     retcode = oauth_fetch(soo, fetchurl, http_method, request_args, request_headers, NULL, OAUTH_FETCH_USETOKEN | OAUTH_OVERRIDE_HTTP_METHOD TSRM     LS_CC);
...

...
1572     if(fetch_flags & OAUTH_OVERRIDE_HTTP_METHOD) {
1573         final_http_method = method;
...

...
1699         if (!strcmp(final_http_method, OAUTH_HTTP_METHOD_GET)) {
...


Expected result:
----------------
I think there maybe some way to gave the final_http_method a 
default value.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-07-20 14:16 UTC] jawed@php.net
Is this still happening for you on trunk? I believe it is fixed.

- JJ
 [2011-07-20 22:04 UTC] iammutex at gmail dot com
I think the v1.2 package on the below page is still have this 
problem

http://pecl.php.net/package/oauth
 [2011-07-20 22:16 UTC] jawed@php.net
Can you check out svn trunk?

http://svn.php.net/viewvc/pecl/oauth/trunk/

$ svn checkout https://svn.php.net/repository/pecl/oauth/trunk

- JJ
 [2011-07-20 22:29 UTC] iammutex at gmail dot com
I've seen that
thx
 [2011-07-21 16:30 UTC] jawed@php.net
Thank you for your bug report. This issue has been fixed
in the latest released version of the package, which you can download at
http://pecl.php.net/get/oauth


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 08:01:30 2024 UTC