php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74326 Segmentation Fault on OAuth::fetch() using GET
Submitted: 2017-03-28 09:42 UTC Modified: 2021-10-31 04:22 UTC
Votes:2
Avg. Score:5.0 ± 0.0
Reproduced:2 of 2 (100.0%)
Same Version:1 (50.0%)
Same OS:0 (0.0%)
From: emir@php.net Assigned: cmb (profile)
Status: No Feedback Package: oauth (PECL)
PHP Version: 7.0.17 OS: MacOS 10.12.3
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: emir@php.net
New email:
PHP Version: OS:

 

 [2017-03-28 09:42 UTC] emir@php.net
Description:
------------
Oauth::fetch() causes segfault with PHP 7.0.17. Please check the test script below.

The same segfault was reported back in 2009 with PHP 5.2.6. Here is the link to original bug:
https://bugs.php.net/bug.php?id=58871

However this bug is not reproducible in PHP 7.1.3, where it throws the correct  expected exception.

Test script:
---------------
<?php
$oauth = new OAuth('8X5OMIyjnqmGiWmiGPw4Jg','Jy8S6TT1JXtS6mUBlOg0b0I6SOoya7mXfm5ADBGTw',OAUTH_SIG_METHOD_HMACSHA1,OAUTH_AUTH_TYPE_AUTHORIZATION);
$oauth->setToken('39469703-nqrXqjB7Vz1CE3dzd9PKqYiCzLozBS5otvsp63g1U','osIx9jLlcouXSZxnX4vo0OvNsNZR07vJDH0VC6Bqg');
$oauth->enableDebug();
$params['cursor'] = -1;
$data = $oauth->fetch("http://twitter.com/followers/ids.json",$params,OAUTH_HTTP_METHOD_GET); // this call causes segmentation fault
$json = json_decode($data);
var_dump($json);

Expected result:
----------------
PHP Fatal error:  Uncaught OAuthException: Invalid auth/bad request (got a 404, expected HTTP/1.1 20X or a redirect) in /private/tmp/a.php:6
Stack trace:
#0 /private/tmp/a.php(6): OAuth->fetch('http://twitter....', Array, 'GET')
#1 {main}
  thrown in /private/tmp/a.php on line 6

Fatal error: Uncaught OAuthException: Invalid auth/bad request (got a 404, expected HTTP/1.1 20X or a redirect) in /private/tmp/a.php:6
Stack trace:
#0 /private/tmp/a.php(6): OAuth->fetch('http://twitter....', Array, 'GET')
#1 {main}
  thrown in /private/tmp/a.php on line 6

Actual result:
--------------
[1]    40959 segmentation fault  /usr/local/opt/php70/bin/php a.php

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-10-20 10:08 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-10-20 10:08 UTC] cmb@php.net
> However this bug is not reproducible in PHP 7.1.3, […]

And what about any of the actively supported PHP versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-10-31 04:22 UTC] pecl-dev at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 13:01:34 2024 UTC