Skip to content

Fix uninitialized WFIFO/RFIFO buffer memory on realloc - #3439

Open
MrKeiKun wants to merge 1 commit into
HerculesWS:masterfrom
MrKeiKun:fix/issue-1743-wfifohead-uninitialized-buffer
Open

Fix uninitialized WFIFO/RFIFO buffer memory on realloc#3439
MrKeiKun wants to merge 1 commit into
HerculesWS:masterfrom
MrKeiKun:fix/issue-1743-wfifohead-uninitialized-buffer

Conversation

@MrKeiKun

Copy link
Copy Markdown
Contributor

Pull Request Prelude

Changes Proposed

  • realloc_fifo(): zero the newly added tail of rdata/wdata after each RECREATE, when the new size is larger than the old one.
  • realloc_writefifo(): same, but only on the grow path (the shrink path frees no new memory, so nothing to zero there).
  • Both are guarded against a hypothetical shrink-sized "grow" call to avoid a size_t underflow in the memset length.

Issues addressed: #1743

Fixes uninitialized heap memory being sent to clients when packet
buffers grow, as realloc() does not clear newly extended memory.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant