Remove dead rv assignment in OpaqueResponseUtils.h
Categories
(Core :: Networking: HTTP, task, P3)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox157 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: gustavokrm, Mentored)
References
(Blocks 1 open bug)
Details
(Keywords: good-first-bug, Whiteboard: [lang=c++], [necko-triaged])
Attachments
(1 file)
Filing as a good first bug to learn workflows.
The clang static analyzer (scan-build) found a dead assignment to rv in OpaqueResponseFilter::DetermineContentType. The return value of httpChannel->GetContentType(contentType) is stored in rv, but rv is never read afterwards (the code branches on contentType.IsEmpty() instead). That assignment is dead.
The fix is to call httpChannel->GetContentType(contentType); directly without assigning to rv.
Link to the code:
https://searchfox.org/mozilla-central/source/netwerk/protocol/http/OpaqueResponseUtils.h#175
To verify the fix:
./mach build netwerk/protocol/http
The change should not alter behavior: the result of GetContentType was already ignored; only the dead store is removed.
Tutorial to contribute:
https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
https://firefox-source-docs.mozilla.org/contributing/stack_quickref.html
Please don't ask for the bug to be assigned. It will be automatically assigned to the first patch.
| Reporter | ||
Updated•3 months ago
|
| Assignee | ||
Comment 2•24 days ago
|
||
Updated•24 days ago
|
Updated•24 days ago
|
Comment 4•23 days ago
|
||
| bugherder | ||
Updated•18 days ago
|
Description
•