Skip to content

transport: prevent nil pointer dereference in recvBuffer.put. - #9533

Merged
Pranjali-2501 merged 1 commit into
grpc:masterfrom
Pranjali-2501:bug-fix-vul
Oct 16, 2026
Merged

Pranjali-2501 merged 1 commit into
grpc:masterfrom
Pranjali-2501:bug-fix-vul

Conversation

@Pranjali-2501

Copy link
Copy Markdown
Contributor

When b.err is already set on a recvBuffer, put() drops every later recvMsg and frees its buffer by calling r.buffer.Free(). A recvMsg that carries only an error or io.EOF has no payload, so its buffer is nil, and the Free() call panics with a nil pointer dereference.

This change adds a nil check before calling r.buffer.Free() and adds an end-to-end test covering this scenario.

RELEASE NOTES:

  • transport: Fix a server panic (nil pointer dereference) that a client could trigger by sending a second DATA frame with END_STREAM on a stream whose RPC handler had already returned.

@codecov

codecov Bot commented Oct 16, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 87.81%. Comparing base (529d6e8) to head (333ae56).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #9533      +/-   ##
==========================================
+ Coverage   87.76%   87.81%   +0.04%     
==========================================
  Files         437      437              
  Lines       31406    31407       +1     
==========================================
+ Hits        27565    27579      +14     
+ Misses       3841     3828      -13     
Files with missing lines Coverage Δ
internal/transport/transport.go 94.05% <100.00%> (+0.03%) ⬆️

... and 19 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Pranjali-2501
Pranjali-2501 merged commit ecbf7d6 into grpc:master Oct 16, 2026
28 of 29 checks passed
@Pranjali-2501
Pranjali-2501 deleted the bug-fix-vul branch October 16, 2026 18:53
Pranjali-2501 added a commit that referenced this pull request Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants