Closed
Bug 1236977
Opened 9 years ago
Closed 9 years ago
clang-cl warning: cubeb_wasapi.cpp: variable 'devnode' is used uninitialized [-Wsometimes-uninitialized]
Categories
(Core :: Audio/Video: cubeb, defect)
Core
Audio/Video: cubeb
Tracking
()
RESOLVED
FIXED
mozilla46
Tracking | Status | |
---|---|---|
firefox44 | --- | unaffected |
firefox45 | --- | affected |
firefox46 | --- | fixed |
firefox-esr38 | --- | unaffected |
People
(Reporter: froydnj, Assigned: kinetik)
References
Details
Attachments
(1 file)
(deleted),
patch
|
padenot
:
review+
|
Details | Diff | Splinter Review |
The error is:
48:13.85 c:/m-c/media/libcubeb/src/cubeb_wasapi.cpp(1549,7) : warning(clang): variable 'devnode' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
48:13.85 if (FAILED(hr)) goto done;
48:13.85 ^~~~~~~~~~
48:13.85 C:\Program Files (x86)\Windows Kits\8.1\include\shared\winerror.h(26237,20) : note(clang): expanded from macro 'FAILED'
48:13.85 #define FAILED(hr) (((HRESULT)(hr)) < 0)
48:13.85 ^~~~~~~~~~~~~~~~~~~~~
48:13.85 c:/m-c/media/libcubeb/src/cubeb_wasapi.cpp(1626,15) : note(clang): uninitialized use occurs here
48:13.85 SafeRelease(devnode);
48:13.85 ^~~~~~~
48:13.85 c:/m-c/media/libcubeb/src/cubeb_wasapi.cpp(1549,3) : note(clang): remove the 'if' if its condition is always false
48:13.85 if (FAILED(hr)) goto done;
48:13.86 ^~~~~~~~~~~~~~~~~~~~~~~~~
It looks like devnode is not initialized, but we can get to the |done:| label before it is. I think SafeRelease will be OK if we pass a garbage value to CloseHandle, but it'd be better to fix the bug so the compile doesn't complain.
Filing this as s-s because this is media code and I'm not familiar with Windows; please open this up if it's really just a garden variety warning.
Updated•9 years ago
|
Group: core-security → media-core-security
Assignee | ||
Comment 1•9 years ago
|
||
This is new code added as part of the device enumeration work.
Blocks: 1225703
Assignee | ||
Comment 2•9 years ago
|
||
Simple fix - initialize devnode to NULL.
Updated•9 years ago
|
Attachment #8704477 -
Flags: review?(padenot) → review+
Updated•9 years ago
|
status-firefox44:
--- → unaffected
status-firefox45:
--- → affected
status-firefox46:
--- → affected
status-firefox-esr38:
--- → unaffected
Assignee | ||
Comment 3•9 years ago
|
||
This code is new and isn't actually used anywhere in Gecko yet. wasapi_create_device is internal and only called by wasapi_enumerate_devices, which is exposed as cubeb_enumerate_devices via the external API and is never called in Gecko code: http://mxr.mozilla.org/mozilla-central/search?string=cubeb_enumerate_devices
So while the code is present in Firefox 45, I don't think we need to backport the fix. And because the code is not yet exposed in any way, I don't think we need to treat this as a security issue.
Assignee | ||
Comment 4•9 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/dd7c4f457433d5a9f65a4a6007dbfe389081c248
Bug 1236977 - Default initialize IMMDevice temporary to avoid potential garbage CloseHandle on error. r=padenot
Assignee | ||
Updated•9 years ago
|
Group: media-core-security
Comment 5•9 years ago
|
||
bugherder |
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla46
You need to log in
before you can comment on or make changes to this bug.
Description
•