From: Zhiyi Zhang zzhang@codeweavers.com
Also, this fixes an out-of-bounds write because the space for the terminating '\0' wasn't included previously. --- dlls/oledb32/datainit.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/dlls/oledb32/datainit.c b/dlls/oledb32/datainit.c index c2066712f8b..0d321932991 100644 --- a/dlls/oledb32/datainit.c +++ b/dlls/oledb32/datainit.c @@ -903,7 +903,7 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I IDBProperties_Release(props);
/* check if we need to skip password */ - len = lstrlenW(progid) + lstrlenW(providerW) + 1; /* including ';' */ + len = lstrlenW(progid) + lstrlenW(providerW) + 1; /* including '\0' */ for (i = 0; i < count; i++) { WCHAR *descr = get_propinfo_descr(&propset->rgProperties[i], propinfoset); @@ -926,7 +926,6 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I /* provider name */ lstrcatW(*init_string, providerW); lstrcatW(*init_string, progid); - lstrcatW(*init_string, L";"); CoTaskMemFree(progid);
for (i = 0; i < count; i++) @@ -938,10 +937,10 @@ static HRESULT WINAPI datainit_GetInitializationString(IDataInitialize *iface, I descr = get_propinfo_descr(&propset->rgProperties[i], propinfoset); if (descr) { + lstrcatW(*init_string, L";"); lstrcatW(*init_string, descr); lstrcatW(*init_string, L"="); write_propvalue_str(*init_string, &propset->rgProperties[i]); - lstrcatW(*init_string, L";"); } }