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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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