Skip to content

golang: should avoid using an uninitialized request #39241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

spacewander
Copy link
Contributor

Thanks for the report from @johnlanni

Commit Message:
Additional Description:
Risk Level: Low
Testing:
Docs Changes:
Release Notes:
Platform Specific Features:
[Optional Runtime guard:]
[Optional Fixes #Issue]
[Optional Fixes commit #PR or SHA]
[Optional Deprecated:]
[Optional API Considerations:]

Signed-off-by: spacewander <spacewanderlzx@gmail.com>
Copy link

As a reminder, PRs marked as draft will not be automatically assigned reviewers,
or be handled by maintainer-oncall triage.

Please mark your PR as ready when you want it to be reviewed!

🐱

Caused by: #39241 was opened by spacewander.

see: more, trace.

@spacewander spacewander marked this pull request as ready for review April 27, 2025 13:42
Copy link
Contributor

@johnlanni johnlanni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -351,6 +352,10 @@ func envoyGoFilterOnHttpLog(r *C.httpRequest, logType uint64,
//export envoyGoFilterOnHttpStreamComplete
func envoyGoFilterOnHttpStreamComplete(r *C.httpRequest) {
req := getRequest(r)
if req == nil {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should similar handling also be done in envoyGoFilterOnHttpDestroy?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I submit a new commit to follow the DRY rule.

@spacewander spacewander changed the title golang: should check req == nil on stream complete golang: should avoid using an uninitialized request Apr 28, 2025
Signed-off-by: 罗泽轩 <spacewanderlzx@gmail.com>
Copy link
Contributor

@johnlanni johnlanni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

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.

3 participants