php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9249 tempnam() may return bad filename
Submitted: 2001-02-13 19:33 UTC Modified: 2001-04-27 21:46 UTC
From: seeliger dot curt at epa dot gov Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.0.4pl1 OS: linux
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: seeliger dot curt at epa dot gov
New email:
PHP Version: OS:

 

 [2001-02-13 19:33 UTC] seeliger dot curt at epa dot gov
$dir='/foo/bar/';
$prefix='prefix';
$tname=tempnam($dir, $prefix);
print("tname");

prints '/foo/bar//prefiR5uKI4'

It'd be nice if the first argument was checked for a final '/' before creating the file name.

Thanks.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-27 21:46 UTC] elixer@php.net
The sample code you provide works perfectly for me.  Try with the latest cvs snapshot (http://snaps.php.net/) and see if that fixes it on your end.

Sean
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 27 17:01:28 2024 UTC