php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68823 Useles check
Submitted: 2015-01-13 05:12 UTC Modified: 2018-08-05 04:00 UTC
From: bugreports at internot dot info Assigned: carusogabriel (profile)
Status: Closed Package: *General Issues
PHP Version: master-Git-2015-01-13 (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:

 

 [2015-01-13 05:12 UTC] bugreports at internot dot info
Description:
------------
Hi,

In /main/php_open_temporary_file.c:

247#ifdef P_tmpdir
248        /* Use the standard default temporary directory. */
249        if (P_tmpdir) {
250                temporary_directory = strdup(P_tmpdir);
251                return temporary_directory;
252        }
253#endif


249        if (P_tmpdir) {
is useless due to 2 reasons:
1. it's an array, and cannot be NULL.
2. the check at line 247 should be fine as it is.


Thanks,



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-13 19:15 UTC] phpmpan at mpan dot pl
`P_tmpdir` has type `char*`: <https://www.gnu.org/software/libc/manual/html_node/Temporary-Files.html>.
 [2018-08-05 04:00 UTC] carusogabriel@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: carusogabriel
 [2018-08-05 04:00 UTC] carusogabriel@php.net
Closing as phpmpan said, it has the `char *` type and can be null: `P_tmpdir` has type `char*`: <https://www.gnu.org/software/libc/manual/html_node/Temporary-Files.html>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC