php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #43385 browser_reg_compare frees stack variable
Submitted: 2007-11-23 06:31 UTC Modified: 2009-02-11 22:04 UTC
From: andy at petdance dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3CVS-2007-11-23 (CVS) OS: *
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: andy at petdance dot com
New email:
PHP Version: OS:

 

 [2007-11-23 06:31 UTC] andy at petdance dot com
Description:
------------
At the tail end of browser_reg_compare, it frees stack variable r.  This is never appropriate.




Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-11-23 06:47 UTC] andy at petdance dot com
Then again, it seems to be happening all over, not just in this one function.  It sure seems to be a segfault waiting to happen.
 [2007-11-26 10:49 UTC] jani@php.net
You mean regfree() is not appropriate? How come?
 [2007-11-26 13:54 UTC] andy at petdance dot com
Because you never call free() on something that has not been malloc()ed.
 [2007-11-26 18:11 UTC] jani@php.net
man regfree():

"Supplying  regfree()  with  a  precompiled pattern buffer, preg will free the memory allocated to the pattern buffer by the compiling process, regcomp()."


 [2007-12-04 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2009-02-11 22:04 UTC] felipe@php.net
Now it uses PCRE.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Aug 17 14:00:03 2025 UTC