-
Notifications
You must be signed in to change notification settings - Fork 7.6k
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
Fix Attempt to free an uninitialized memory pointer in vorbis_deinit
(GHSL-2023-169/CVE-2023-45679
)
#1557
Open
JarLob
wants to merge
1
commit into
nothings:master
Choose a base branch
from
JarLob:patch-18
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…` (`GHSL-2023-169/CVE-2023-45679`)
This #1557 and next #1558 must be combined into the following, and #1558 must be discarded. diff --git a/stb_vorbis.c b/stb_vorbis.c
index 3e5c250..3dbfb55 100644
--- a/stb_vorbis.c
+++ b/stb_vorbis.c
@@ -3662,7 +3662,11 @@ static int start_decoder(vorb *f)
if (f->comment_list_length > 0)
{
f->comment_list = (char**) setup_malloc(f, sizeof(char*) * (f->comment_list_length));
- if (f->comment_list == NULL) return error(f, VORBIS_outofmem);
+ if (f->comment_list == NULL) {
+ f->comment_list_length = 0;
+ return error(f, VORBIS_outofmem);
+ }
+ memset(f->comment_list, 0, sizeof(char*) * f->comment_list_length);
}
for(i=0; i < f->comment_list_length; ++i) { |
sezero
added a commit
to sezero/SDL_mixer
that referenced
this pull request
Dec 11, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings/stb#1557 and nothings/stb#1558 GHSL-2023-169/CVE-2023-45679: Attempt to free an uninitialized memory pointer in vorbis_deinit() GHSL-2023-170/CVE-2023-45680: Null pointer dereference in vorbis_deinit()
icculus
pushed a commit
to libsdl-org/SDL_mixer
that referenced
this pull request
Dec 11, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings/stb#1557 and nothings/stb#1558 GHSL-2023-169/CVE-2023-45679: Attempt to free an uninitialized memory pointer in vorbis_deinit() GHSL-2023-170/CVE-2023-45680: Null pointer dereference in vorbis_deinit()
sezero
added a commit
to libsdl-org/SDL_mixer
that referenced
this pull request
Dec 11, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings/stb#1557 and nothings/stb#1558 GHSL-2023-169/CVE-2023-45679: Attempt to free an uninitialized memory pointer in vorbis_deinit() GHSL-2023-170/CVE-2023-45680: Null pointer dereference in vorbis_deinit() (cherry picked from commit 4361f57)
sezero
added a commit
to icculus/SDL_sound
that referenced
this pull request
Dec 11, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings/stb#1557 and nothings/stb#1558 GHSL-2023-169/CVE-2023-45679: Attempt to free an uninitialized memory pointer in vorbis_deinit() GHSL-2023-170/CVE-2023-45680: Null pointer dereference in vorbis_deinit()
sezero
added a commit
to sezero/libxmp
that referenced
this pull request
Dec 11, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings/stb#1557 and nothings/stb#1558 GHSL-2023-169/CVE-2023-45679: Attempt to free an uninitialized memory pointer in vorbis_deinit() GHSL-2023-170/CVE-2023-45680: Null pointer dereference in vorbis_deinit()
sezero
added a commit
to sezero/stb
that referenced
this pull request
Dec 12, 2023
Based on the patches by Jaroslav Lobačevski (@JarLob) submitted to mainstream at: nothings#1557 and nothings#1558 GHSL-2023-169/CVE-2023-45679: Attempt to free an uninitialized memory pointer in vorbis_deinit() GHSL-2023-170/CVE-2023-45680: Null pointer dereference in vorbis_deinit()
NBickford-NV
added a commit
to NBickford-NV/stb
that referenced
this pull request
Feb 17, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
A crafted file may trigger memory allocation failure in
start_decoder
at [1]. In that case the function returns early [2], but some of the pointers inf->comment_list
are left initialized [3].Later
setup_free
is called on these pointers invorbis_deinit
[4].Impact
This issue may lead to code execution.
Resources
To reproduce the issue:
AddressSanitizer: requested allocation size ... exceeds maximum supported size
):ASAN_OPTIONS=allocator_may_return_null=1 <program name>
to hit the error.