1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 12:07:45 +00:00
serenity/Userland
Daniel Bertalan e9f0ebd4bd LibHTTP: Fix logic error leading to buffer over-read
When we receive HTTP payloads, we have to ensure that the number of
bytes read is *at most* the value specified in the Content-Length
header.

However, we did not use the correct value when calculating the truncated
size of the last payload. `m_buffered_size` does not store the total
number of bytes received, but rather the number of bytes that haven't
been read from us.

This means that if some data has already been read from us,
`m_buffered_size` is smaller than `m_received_size`. Because of this, we
ended up resizing the `payload` ByteBuffer to a larger size than its
contents. This garbage data was then read by consumers, producing this
warning when executing scripts:

> Extension byte 0xdc in 1 position after first byte 0xdc doesn't make
> sense.
2021-10-30 00:54:34 +03:30
..
Applets Everywhere: Rename left/right-click to primary/secondary 2021-10-27 22:05:58 +03:00
Applications ThemeEditor: Display the theme's window icons in the preview 2021-10-28 11:23:44 +02:00
Demos Everywhere: Rename back-click to backward-click 2021-10-27 22:05:58 +03:00
DevTools HackStudio: Add 'Show Dotfiles' option 2021-10-29 22:40:11 +02:00
DynamicLoader Toolchain+Meta: Update LLVM version to 13.0.0 2021-10-17 17:09:58 +01:00
Games Minesweeper: Set time label to a fixed width 2021-10-29 23:02:24 +03:00
Libraries LibHTTP: Fix logic error leading to buffer over-read 2021-10-30 00:54:34 +03:30
Services LibWeb: Null-check document before doing layout in PageHost::paint() 2021-10-28 18:29:49 +02:00
Shell Shell: Prevent exponential explosion around '$((' 2021-10-23 19:29:59 +01:00
Utilities wc: Count last line even if it doesn't end in newline 2021-10-29 22:37:34 +03:00
CMakeLists.txt Tests: Establish root Tests directory, move Userland/Tests there 2021-05-06 17:54:28 +02:00