Commit b26087c3 authored by Mike McCormack's avatar Mike McCormack Committed by Alexandre Julliard

Fix buffer overflow.

parent abd259fd
...@@ -349,7 +349,7 @@ UINT WINAPI MsiRecordSetStringA( MSIHANDLE handle, unsigned int iField, LPCSTR s ...@@ -349,7 +349,7 @@ UINT WINAPI MsiRecordSetStringA( MSIHANDLE handle, unsigned int iField, LPCSTR s
return ERROR_INVALID_FIELD; return ERROR_INVALID_FIELD;
len = MultiByteToWideChar( CP_ACP, 0, szValue, -1, NULL, 0 ); len = MultiByteToWideChar( CP_ACP, 0, szValue, -1, NULL, 0 );
str = HeapAlloc( GetProcessHeap(), 0, len ); str = HeapAlloc( GetProcessHeap(), 0, len*sizeof(WCHAR) );
MultiByteToWideChar( CP_ACP, 0, szValue, -1, str, len ); MultiByteToWideChar( CP_ACP, 0, szValue, -1, str, len );
MSI_FreeField( &rec->fields[iField] ); MSI_FreeField( &rec->fields[iField] );
rec->fields[iField].type = MSIFIELD_WSTR; rec->fields[iField].type = MSIFIELD_WSTR;
...@@ -372,7 +372,7 @@ UINT WINAPI MsiRecordSetStringW( MSIHANDLE handle, unsigned int iField, LPCWSTR ...@@ -372,7 +372,7 @@ UINT WINAPI MsiRecordSetStringW( MSIHANDLE handle, unsigned int iField, LPCWSTR
if( iField > rec->count ) if( iField > rec->count )
return ERROR_INVALID_FIELD; return ERROR_INVALID_FIELD;
str = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(szValue) + 1)*sizeof str[0]); str = HeapAlloc( GetProcessHeap(), 0, (lstrlenW(szValue) + 1)*sizeof (WCHAR));
lstrcpyW( str, szValue ); lstrcpyW( str, szValue );
MSI_FreeField( &rec->fields[iField] ); MSI_FreeField( &rec->fields[iField] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment