Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a memory leak defect at line 82 in the file /openssl/test/ecstresstest.c. #24476

Closed
LuMingYinDetect opened this issue May 23, 2024 · 0 comments
Labels
branch: master Merge to master branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 branch: 3.2 Merge to openssl-3.2 branch: 3.3 Merge to openssl-3.3 good first issue Bite size change that could be a good start triaged: bug The issue/pr is/fixes a bug

Comments

@LuMingYinDetect
Copy link

In the file /openssl/test/ecstresstest.c, at line 69, a pointer variable named group is defined. At line 78, this variable is assigned a dynamically allocated memory region through the function EC_GROUP_new_by_curve_name. The if statement at line 78 has three conditions connected by ||. When the first condition (line 78) returns false, it indicates that the memory allocation for group was successful. However, if the second condition (line 79) returns true, the function will return at line 82, preventing the release of the dynamically allocated memory for group at line 97, thus causing a memory leak. The code flow is illustrated in the diagram below(note that the defect path provided in the figure does not match my description; my description should be considered accurate):
https://github.com/LuMingYinDetect/openssl_defects/blob/main/openssl_30.png

@LuMingYinDetect LuMingYinDetect added the issue: bug report The issue was opened to report a bug label May 23, 2024
@t8m t8m added branch: master Merge to master branch good first issue Bite size change that could be a good start triaged: bug The issue/pr is/fixes a bug branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 branch: 3.2 Merge to openssl-3.2 branch: 3.3 Merge to openssl-3.3 and removed issue: bug report The issue was opened to report a bug labels May 23, 2024
NekSaikou added a commit to NekSaikou/openssl that referenced this issue May 24, 2024
Nek
NekSaikou@proton.me
Fri May 24 10:45:01 2024 +0000
NekSaikou added a commit to NekSaikou/openssl that referenced this issue May 24, 2024
NekSaikou@proton.me
Fri May 24 10:45:01 2024 +0000
CLA: trivial
openssl-machine pushed a commit that referenced this issue May 28, 2024
Fixes #24476
CLA: trivial

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #24488)

(cherry picked from commit 434e7f7)
openssl-machine pushed a commit that referenced this issue May 28, 2024
Fixes #24476
CLA: trivial

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #24488)

(cherry picked from commit 434e7f7)
openssl-machine pushed a commit that referenced this issue May 28, 2024
Fixes #24476
CLA: trivial

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #24488)

(cherry picked from commit 434e7f7)
openssl-machine pushed a commit that referenced this issue May 28, 2024
Fixes #24476
CLA: trivial

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #24488)

(cherry picked from commit 434e7f7)
jvdsn pushed a commit to jvdsn/openssl that referenced this issue Jun 3, 2024
Fixes openssl#24476
CLA: trivial

Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from openssl#24488)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
branch: master Merge to master branch branch: 3.0 Merge to openssl-3.0 branch branch: 3.1 Merge to openssl-3.1 branch: 3.2 Merge to openssl-3.2 branch: 3.3 Merge to openssl-3.3 good first issue Bite size change that could be a good start triaged: bug The issue/pr is/fixes a bug
Projects
None yet
Development

No branches or pull requests

2 participants