Closed
Bug 1231677
Opened 9 years ago
Closed 9 years ago
[Static Analysis][Unchecked return value] In function MulticastDNSDeviceProvider::ForceDiscovery from MulticastDNSDeviceProvider.cpp
Categories
(Core :: DOM: Core & HTML, defect)
Core
DOM: Core & HTML
Tracking
()
RESOLVED
FIXED
mozilla46
People
(Reporter: andi, Assigned: andi)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: CID 1325947)
Attachments
(1 file)
1.38 KB,
patch
|
jst
:
review+
|
Details | Diff | Splinter Review |
The Static Analysis tool Coverity added that return value from mDiscoveryTimer->Init() is not checked. As it can bee seen from the code if that functions fails a waning message will be triggered: >> if (mIsDiscovering) { >> Unused << mDiscoveryTimer->Cancel(); >> >> NS_WARN_IF(NS_FAILED(mDiscoveryTimer->Init(this, >> mDiscveryTimeoutMs, >> nsITimer::TYPE_ONE_SHOT))); >> return NS_OK; >> } Since the mDiscoveryTimer->Init function fails, i think we should also return the error code and stop the execution of the function and return to: MulticastDNSDeviceProvider::Init() The code that i'm referring to, that verifies the status of ForceDiscovery is: >> Unused << mPresentationServer->SetId(mServiceName); >> >> if (mDiscoveryEnabled && NS_WARN_IF(NS_FAILED(rv = ForceDiscovery()))) { >> return rv; >> }
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8697276 -
Flags: review?(jst)
Updated•9 years ago
|
Attachment #8697276 -
Flags: review?(jst) → review+
Assignee | ||
Updated•9 years ago
|
Keywords: checkin-needed
Comment 3•9 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/094fd5a4d3dc
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox46:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
Updated•5 years ago
|
Component: DOM → DOM: Core & HTML
You need to log in
before you can comment on or make changes to this bug.
Description
•