mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-22 12:35:14 +00:00
LibAudio: Avoid UAF when loading WAV metadata
This commit is contained in:
parent
dc2233ef7a
commit
d186582d30
Notes:
sideshowbarker
2024-07-17 01:00:06 +09:00
Author: https://github.com/tcl3 Commit: https://github.com/SerenityOS/serenity/commit/d186582d30 Pull-request: https://github.com/SerenityOS/serenity/pull/22832
1 changed files with 2 additions and 1 deletions
|
@ -298,7 +298,8 @@ MaybeLoaderError WavLoaderPlugin::parse_header()
|
|||
MaybeLoaderError WavLoaderPlugin::load_wav_info_block(Vector<RIFF::OwnedChunk> info_chunks)
|
||||
{
|
||||
for (auto const& chunk : info_chunks) {
|
||||
auto metadata_name = chunk.id().as_ascii_string();
|
||||
auto chunk_id = chunk.id();
|
||||
auto metadata_name = chunk_id.as_ascii_string();
|
||||
// Chunk contents are zero-terminated strings "ZSTR", so we just drop the null terminator.
|
||||
StringView metadata_text { chunk.data().trim(chunk.size() - 1) };
|
||||
// Note that we assume chunks to be unique, since that seems to almost always be the case.
|
||||
|
|
Loading…
Add table
Reference in a new issue