Commit 90eb14a6 authored by Bruno Jesus's avatar Bruno Jesus Committed by Alexandre Julliard

krnl386.exe16: Skip invalid entries in GetPrivateProfileString16.

parent c87a78bc
......@@ -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 );
......
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