php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #79145 openssl memory leak
Submitted: 2020-01-21 08:24 UTC Modified: 2020-01-21 13:57 UTC
From: adriance at qq dot com Assigned: cmb (profile)
Status: Closed Package: OpenSSL related
PHP Version: 7.3.13 OS: CentOS 7
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: adriance at qq dot com
New email:
PHP Version: OS:

 

 [2020-01-21 08:24 UTC] adriance at qq dot com
Description:
------------
2097152
8392704
14684160
25169920
29364224
31461376
50335744
52432896
54530048
56627200

Test script:
---------------
<?php
$b = '-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDaFhc31WeskqxwI+Si5R/fZrLK
pJOlABiI3RZfKCHJVrXl3IvcHDFM/BHKUJoSi/ee8GS9iw0G4Z1eCzJdthXxHARh
j85Q5OliVxOdB1LoTOsOmfFf/fdvpU3DsOWsDKlVrL41MHxXorwrwOiys/r/gv2d
C9C4JmhTOjBVAK8SewIDAQAC
-----END PUBLIC KEY-----';

for ($i = 0; $i < 1000000; $i++) {
    if ($i % 100000 == 0) {
        echo memory_get_usage(true) . PHP_EOL;
    }
    $a = openssl_get_publickey($b);
    openssl_free_key($a);
}



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2020-01-21 13:57 UTC] cmb@php.net
-Status: Open +Status: Verified -Assigned To: +Assigned To: cmb
 [2020-01-21 13:57 UTC] cmb@php.net
Seems to have been introduced by the fix for bug #61930.
 [2020-01-21 15:22 UTC] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=9eff906a024578f0ea0bf8b4e318544d70074537
Log: Fix #79145: openssl memory leak
 [2020-01-21 15:22 UTC] cmb@php.net
-Status: Verified +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Nov 21 12:01:29 2024 UTC