Repository navigation
Fix: free overwritten multi-handle headers - #1141
Merged
greenbonebot merged 2 commits intoOct 6, 2026
Merged
greenbonebot merged 2 commits into
greenbonebot merged 2 commits into
Conversation
gvm_http_multi_new allocated multi->headers and the assignment discarded that pointer, leaking the gvm_http_headers_t on every successful call.
greenbonebot
enabled auto-merge (rebase)
October 6, 2026 10:44
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Snapshot WarningsEnsure that dependencies are being submitted on PR branches and consider enabling retry-on-snapshot-warnings. See the documentation for more information and troubleshooting advice. Scanned FilesNone |
bjoernricks
approved these changes
Oct 6, 2026
greenbonebot
deleted the
fix/71-conn-stream-resp-multi-handler-headers-customheader-overwrites-multi-handle-heade
branch
October 6, 2026 12:38
This file contains hidden or 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
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.
What
Free the
multi_handle->headersbefore overwriting it with the caller'scustomheaderinhttp_scanner_init_request_multi(http_scanner.c).Why
Assigning
customheaderstraight overmulti_handle->headersdiscarded thegvm_http_headers_tthatgvm_http_multi_newhad just allocated internally,so that allocation was never freed and leaked on every successful call.
Like /pull/1140 gvmd only does the init once, but might as well clean up.
Testing
http_scanner_init_request_multi_replaces_multi_headers(http-scanner-test):before the fix, LeakSanitizer reported an 8-byte direct leak allocated by
gvm_http_headers_new(http/httputils.c:666) fromgvm_http_multi_new;after, the case passes with no leak report.