https://bugs.winehq.org/show_bug.cgi?id=50038
Bug ID: 50038 Summary: IWbemClassObject::Get method with wszName = NULL crashes inside wbemprox Product: Wine Version: 5.19 Hardware: x86-64 OS: Linux Status: NEW Severity: normal Priority: P2 Component: wmi&wbemprox Assignee: wine-bugs@winehq.org Reporter: xerox.xerox2000x@gmail.com Distribution: ---
Trying run powershell (2.0) with something like wine powershell -c get-wmiobject win32_process makes it crash inside wbemprox. It seems to come from
wbemprox:class_object_Get (00FB59D8, (null), 00000000, 059BEA8C, 019194F8, 019194FC)
Then apparently static BOOL is_system_prop( const WCHAR *name ) { return (name[0] == '_' && name[1] == '_'); } goes wrong
That wszName is null is probably due to previous bugs/insufficiencies (?guess?), but at least it shouldn`t crash inside wbemprox I think (modified test in tests/query.c with name=NULL shows it returns WBEM_E_INVALID_PARAMETER).
Something like
return (name && name[0] == '_' && name[1] == '_');
helps prevent crash but I don`t know how to fix this properly
Below +wbemprox trace
0130:trace:wbemprox:create_class_object L"Win32_Process", 00FA6930 0130:trace:wbemprox:create_class_object returning iface 00FB59D8 0130:trace:wbemprox:class_object_QueryInterface 00FB59D8, {00000000-0000-0000-c000-000000000046}, 059BE5D0 0130:trace:wbemprox:class_object_QueryInterface 00FB59D8, {c3fcc19e-a970-11d2-8b5a-00a0c9b7c9c4}, 059BE584 0130:fixme:wbemprox:class_object_QueryInterface interface {c3fcc19e-a970-11d2-8b5a-00a0c9b7c9c4} not implemented 0130:trace:wbemprox:class_object_QueryInterface 00FB59D8, {b196b283-bab4-101a-b69c-00aa00341d07}, 059BE478 0130:fixme:wbemprox:class_object_QueryInterface interface {b196b283-bab4-101a-b69c-00aa00341d07} not implemented 0130:trace:wbemprox:class_object_QueryInterface 00FB59D8, {00000003-0000-0000-c000-000000000046}, 059BE3F8 0130:fixme:wbemprox:class_object_QueryInterface interface {00000003-0000-0000-c000-000000000046} not implemented 0130:trace:wbemprox:class_object_QueryInterface 00FB59D8, {00000144-0000-0000-c000-000000000046}, 059BE47C 0130:fixme:wbemprox:class_object_QueryInterface interface {00000144-0000-0000-c000-000000000046} not implemented 0130:trace:wbemprox:class_object_QueryInterface 00FB59D8, {dc12a681-737f-11cf-884d-00aa004b2e24}, 059BE8A0 0130:trace:wbemprox:class_object_Get 00FB59D8, L"__GENUS", 00000000, 059BF1B8, 059BF27C, 059BF278 0130:trace:wbemprox:class_object_Get 00FB59D8, L"__PATH", 00000000, 059BF19C, 059BF264, 059BF260 0130:fixme:ole:thread_context_info_QueryInterface interface not implemented {51372ae0-cae7-11cf-be81-00aa00a2fa25} 0130:fixme:wmiutils:wmiutils_cf_QueryInterface interface {b196b28f-bab4-101a-b69c-00aa00341d07} not implemented 0130:fixme:wmiutils:path_QueryInterface interface {c3fcc19e-a970-11d2-8b5a-00a0c9b7c9c4} not implemented 0130:fixme:wmiutils:path_QueryInterface interface {00000003-0000-0000-c000-000000000046} not implemented 0130:fixme:wmiutils:path_QueryInterface interface {00000144-0000-0000-c000-000000000046} not implemented 0130:trace:wbemprox:class_object_Get 00FB59D8, L"__NAMESPACE", 00000000, 059BEF4C, 018EDB90, 018EDB94 0130:trace:wbemprox:class_object_Get 00FB59D8, L"__NAMESPACE", 00000000, 059BEF50, 018EDB90, 018EDB94 0130:trace:wbemprox:class_object_Get 00FB59D8, L"__CLASS", 00000000, 059BEF4C, 018EDC48, 018EDC4C 0130:trace:wbemprox:class_object_Get 00FB59D8, L"__CLASS", 00000000, 059BEF50, 018EDC48, 018EDC4C 0130:trace:wbemprox:class_object_GetNames 00FB59D8, (null), 00000030, 059BEA94 {VT_EMPTY}, 059BEA60 0130:fixme:wbemprox:class_object_GetNames qualifier not supported 0130:trace:wbemprox:class_object_Get 00FB59D8, (null), 00000000, 059BEA8C, 019194F8, 019194FC 0130:fixme:wer:WerReportSetParameter (00FBBED0, 0, L"NameOfExe", L"powershell51.exe") :stub 0130:fixme:wer:WerReportSetParameter (00FBBED0, 1, L"FileVersionOfSystemManagementAutomation", L"6.0.6002.18111") :stub 0130:fixme:wer:WerReportSetParameter (00FBBED0, 2, L"InnermostExceptionType", L"System.AccessViolationException") :stub 0130:fixme:wer:WerReportSetParameter (00FBBED0, 3, L"OutermostExceptionType", L"System.AccessViolationException") :stub 0130:fixme:wer:WerReportSetParameter (00FBBED0, 5, L"DeepestFrame", L"stem.Management.IWbemClassObjectFreeThreaded.Get_f") :stub 0130:fixme:wer:WerReportSetParameter (00FBBED0, 4, L"DeepestPowerShellFrame", L"utomation.ManagementClassApdapter.AddAllProperties") :stub 0130:fixme:wer:WerReportSetParameter (00FBBED0, 6, L"ThreadName", L"Pipeli..ution Thread") :stub 0130:fixme:wer:WerReportAddDump (00FBBED0, 0000016C, 00000000, 2, 00000000, 00000000, 0) :stub 0130:fixme:advapi:RegisterEventSourceW ((null),L".NET Runtime"): stub 0130:fixme:advapi:ReportEventW (CAFE4242,0x0001,0x0000,0x000003ff,00000000,0x0001,0x00000000,059BC580,00000000): stub 0130:err:eventlog:ReportEventW L".NET Runtime version 2.0.50727.1433 - Attempted to read or write protected memory. This is often an indication that other memory is corrupt."