Module: wine Branch: master Commit: 8105a1207b8f3095e7046fd56fd0f2a9ff4efc63 URL: http://source.winehq.org/git/wine.git/?a=commit;h=8105a1207b8f3095e7046fd56f...
Author: Marcus Meissner meissner@suse.de Date: Mon Jan 7 22:17:22 2013 +0100
oledb32: Check start for NULL before strstrW (Coverity).
---
dlls/oledb32/datainit.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/dlls/oledb32/datainit.c b/dlls/oledb32/datainit.c index a870bbc..aa61d3b 100644 --- a/dlls/oledb32/datainit.c +++ b/dlls/oledb32/datainit.c @@ -414,8 +414,6 @@ static HRESULT WINAPI datainit_GetDataSource(IDataInitialize *iface, IUnknown *o /* now set properties */ if (initstring) { - static const WCHAR scolW[] = {';',0}; - static const WCHAR eqW[] = {'=',0}; WCHAR *eq, *start;
hr = IUnknown_QueryInterface(*datasource, &IID_IDBProperties, (void**)&dbprops); @@ -426,10 +424,10 @@ static HRESULT WINAPI datainit_GetDataSource(IDataInitialize *iface, IUnknown *o }
start = initstring; - while ((eq = strstrW(start, eqW))) + while (start && (eq = strchrW(start, '='))) { static const WCHAR providerW[] = {'P','r','o','v','i','d','e','r',0}; - WCHAR *scol = strstrW(eq+1, scolW); + WCHAR *scol = strchrW(eq+1, ';'); BSTR value, name;
name = SysAllocStringLen(start, eq - start);