Make sure not to strcpy from a NULL default value pointer.
This commit is contained in:
parent
8c523fe36c
commit
4e700d36e0
|
@ -1112,10 +1112,12 @@ static int PROFILE_GetPrivateProfileString( LPCWSTR section, LPCWSTR entry,
|
|||
else
|
||||
/* PROFILE_GetString can handle the 'entry == NULL' case */
|
||||
ret = PROFILE_GetString( section, entry, pDefVal, buffer, len, win32 );
|
||||
} else {
|
||||
} else if (buffer && pDefVal) {
|
||||
lstrcpynW( buffer, pDefVal, len );
|
||||
ret = strlenW( buffer );
|
||||
}
|
||||
else
|
||||
ret = 0;
|
||||
|
||||
RtlLeaveCriticalSection( &PROFILE_CritSect );
|
||||
|
||||
|
|
Loading…
Reference in New Issue