mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
LibGfx/TIFF: Don't include the null-byte terminator when reading strings
This commit is contained in:
parent
a382ea7c1f
commit
0a80daef90
Notes:
sideshowbarker
2024-07-17 02:29:45 +09:00
Author: https://github.com/LucasChollet Commit: https://github.com/SerenityOS/serenity/commit/0a80daef90 Pull-request: https://github.com/SerenityOS/serenity/pull/22140
1 changed files with 3 additions and 0 deletions
|
@ -378,6 +378,9 @@ private:
|
|||
case Type::ASCII:
|
||||
case Type::UTF8: {
|
||||
Vector<Value, 1> result;
|
||||
// NOTE: No need to include the null terminator
|
||||
if (count > 0)
|
||||
--count;
|
||||
auto string_data = TRY(ByteBuffer::create_uninitialized(count));
|
||||
TRY(m_stream->read_until_filled(string_data));
|
||||
result.empend(TRY(String::from_utf8(StringView { string_data.bytes() })));
|
||||
|
|
Loading…
Reference in a new issue