oledb32: Check start for NULL before strstrW (Coverity).

oldstable
Marcus Meissner 2013-01-07 22:17:22 +01:00 committed by Alexandre Julliard
parent 29957438fb
commit 8105a1207b
1 changed files with 2 additions and 4 deletions

View File

@ -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);