[Bug 37128] New: Clang Static Analyzer: Uninitialized variable in a condition
https://bugs.winehq.org/show_bug.cgi?id=37128 Bug ID: 37128 Summary: Clang Static Analyzer: Uninitialized variable in a condition Product: Wine Version: 1.7.22 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: lukebenes(a)hotmail.com Clang Static Analyzer identifies Uninitialized variable in a condition File: dlls/atl110/../atl/atl_ax.c Location: line 1092, column 10 Description: Branch condition evaluates to a garbage value HRESULT WINAPI AtlAxCreateControlEx(LPCOLESTR lpszName, HWND hWnd, IStream *pStream, IUnknown **ppUnkContainer, IUnknown **ppUnkControl, REFIID iidSink, IUnknown *punkSink) { ... IUnknown *pContainer; ... hRes = AtlAxAttachControl( pUnkControl, hWnd, &pContainer ); if ( FAILED( hRes ) ) WARN("cannot attach control to window\n"); ... if ( pContainer ) //<== //Clang: Branch condition evaluates to a garbage value IUnknown_Release( pContainer ); return S_OK; } The uninitialized variable pContainer is used in the condition after the call of AtlAxAttachControl. This function's description is given below. HRESULT WINAPI AtlAxAttachControl(IUnknown *control, HWND hWnd, IUnknown **container) { HRESULT hr; ... if (!control) return E_INVALIDARG;//<== hr = IOCS_Create( hWnd, control, container ); return hWnd ? hr : S_FALSE; } In this code, the E_INVALIDARG value may be returned before initializing the container variable. It will result in the AtlAxCreateControlEx function generating the warning and going on to work with the uninitialized variable. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37128 --- Comment #1 from Luke <lukebenes(a)hotmail.com> --- Created attachment 49348 --> https://bugs.winehq.org/attachment.cgi?id=49348 clang error report -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37128 --- Comment #2 from Luke <lukebenes(a)hotmail.com> --- Created attachment 49349 --> https://bugs.winehq.org/attachment.cgi?id=49349 clang error report -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37128 --- Comment #3 from Luke <lukebenes(a)hotmail.com> --- Created attachment 49350 --> https://bugs.winehq.org/attachment.cgi?id=49350 clang error report -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37128 --- Comment #4 from Austin English <austinenglish(a)gmail.com> --- This is your friendly reminder that there has been no bug activity for over a year. Is this still an issue in current (1.7.51 or newer) wine? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37128 Kirill K. Smirnov <kirill.k.smirnov(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kirill.k.smirnov(a)gmail.com --- Comment #5 from Kirill K. Smirnov <kirill.k.smirnov(a)gmail.com> --- It seems bug is fixed. The uninitialized variable is now NULL (atl/atl_ax.c:1053) and clang analyzer does not complain too. commit ec52a1f55700989f014851eef0a25641f8bc983a Author: Qian Hong <qhong(a)codeweavers.com> Date: Fri Jan 16 16:09:36 2015 +0800 atl: Improved content type handling of AtlAxCreateControlEx. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37128 super_man(a)post.com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |00cpxxx(a)gmail.com, | |super_man(a)post.com -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37128 Bruno Jesus <00cpxxx(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |FIXED Component|-unknown |atl Summary|Clang Static Analyzer: |Clang: Uninitialized |Uninitialized variable in a |variable in a condition in |condition |atl_ax.c Fixed by SHA1| |ec52a1f55700989f014851eef0a | |25641f8bc983a --- Comment #6 from Bruno Jesus <00cpxxx(a)gmail.com> --- (In reply to Kirill K. Smirnov from comment #5)
It seems bug is fixed. The uninitialized variable is now NULL (atl/atl_ax.c:1053) and clang analyzer does not complain too.
commit ec52a1f55700989f014851eef0a25641f8bc983a Author: Qian Hong <qhong(a)codeweavers.com> Date: Fri Jan 16 16:09:36 2015 +0800
atl: Improved content type handling of AtlAxCreateControlEx.
Assuming fixed. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=37128 Alexandre Julliard <julliard(a)winehq.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #7 from Alexandre Julliard <julliard(a)winehq.org> --- Closing bugs fixed in 1.9.13. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org