Make sure not to strcpy from a NULL default value pointer.

oldstable
Mike McCormack 2005-10-11 19:27:03 +00:00 committed by Alexandre Julliard
parent 8c523fe36c
commit 4e700d36e0
1 changed files with 3 additions and 1 deletions

View File

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