mirror of
git://source.winehq.org/git/wine.git
synced 2024-08-31 14:16:05 +00:00
krnl386.exe16: Skip invalid entries in GetPrivateProfileString16.
Signed-off-by: Bruno Jesus <00cpxxx@gmail.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c87a78bc94
commit
90eb14a6c4
|
@ -539,6 +539,9 @@ INT16 WINAPI GetPrivateProfileString16( LPCSTR section, LPCSTR entry,
|
|||
LPCSTR def_val, LPSTR buffer,
|
||||
UINT16 len, LPCSTR filename )
|
||||
{
|
||||
TRACE("(%s, %s, %s, %p, %u, %s)\n", debugstr_a(section), debugstr_a(entry),
|
||||
debugstr_a(def_val), buffer, len, debugstr_a(filename));
|
||||
|
||||
if (!section)
|
||||
{
|
||||
if (buffer && len) buffer[0] = 0;
|
||||
|
@ -572,7 +575,12 @@ INT16 WINAPI GetPrivateProfileString16( LPCSTR section, LPCSTR entry,
|
|||
{
|
||||
char *p = strchr( src, '=' );
|
||||
|
||||
if (!p) p = src + strlen(src);
|
||||
/* A valid entry is formed by name = value */
|
||||
if (!p)
|
||||
{
|
||||
src += strlen(src) + 1;
|
||||
continue;
|
||||
}
|
||||
if (p - src < len)
|
||||
{
|
||||
memcpy( buffer, src, p - src );
|
||||
|
|
Loading…
Reference in a new issue