php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68692 explicit uninitalized pointer
Submitted: 2014-12-30 04:58 UTC Modified: 2015-01-08 15:45 UTC
From: bugreports at internot dot info Assigned:
Status: Closed Package: *General Issues
PHP Version: master-Git-2014-12-30 (Git) OS: Linux Ubuntu 14.04
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.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: bugreports at internot dot info
New email:
PHP Version: OS:

 

 [2014-12-30 04:58 UTC] bugreports at internot dot info
Description:
------------
Hi,

In /ext/standard/php_fopen_wrapper.c there is an uninitalized pointer read:

149        char *p, *token;
150        php_stream_filter *temp_filter;
151
152        p = php_strtok_r(filterlist, "|", &token);



Thanks,


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-12-31 18:42 UTC] php at mcq8 dot be
What is the problem exactly?
You just create a pointer that will be set by php_strtok_r.
There is no dereference of an uninitalized pointer.
 [2014-12-31 21:09 UTC] bugreports at internot dot info
php_strtok_r(char *s, const char *delim, char **last)
{   
    char *spanp;
    int c, sc;
    char *tok;

    if (s == NULL && (s = *last) == NULL)
    {
        return NULL;
    }

    /*
     * Skip (span) leading delimiters (s += strspn(s, delim), sort of).
     */
cont:
    c = *s++;



?
 [2015-01-08 08:38 UTC] laruence@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7ebdc8d70d7617f2c3353b027663ef54a24a2248
Log: Fixed #68692
 [2015-01-08 08:38 UTC] laruence@php.net
-Status: Open +Status: Closed
 [2015-01-08 15:45 UTC] bugreports at internot dot info
This is invalid.


This can only be triggered if 'stream' is NULL.

php_stream_apply_filter_list is never called if stream is NULL:

>                 if (!(stream = php_stream_open_wrapper(p + 10, mode, options, opened_path))) {
>                         efree(pathdup);
>                         return NULL;
>                 }
 [2016-07-20 11:40 UTC] davey@php.net
Automatic comment on behalf of laruence
Revision: http://git.php.net/?p=php-src.git;a=commit;h=7ebdc8d70d7617f2c3353b027663ef54a24a2248
Log: Fixed #68692
 
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Mon Aug 08 01:05:45 2022 UTC