Bruno Jesus : krnl386.exe16: Skip invalid entries in GetPrivateProfileString16.
Alexandre Julliard
julliard at wine.codeweavers.com
Wed Dec 2 10:21:18 CST 2015
Module: wine
Branch: master
Commit: 90eb14a6c4d4d2549894a04655a6f38ceb6998d2
URL: http://source.winehq.org/git/wine.git/?a=commit;h=90eb14a6c4d4d2549894a04655a6f38ceb6998d2
Author: Bruno Jesus <00cpxxx at gmail.com>
Date: Sat Nov 28 22:47:38 2015 +0100
krnl386.exe16: Skip invalid entries in GetPrivateProfileString16.
Signed-off-by: Bruno Jesus <00cpxxx at gmail.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/krnl386.exe16/file.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
diff --git a/dlls/krnl386.exe16/file.c b/dlls/krnl386.exe16/file.c
index 77908c2..b66b753 100644
--- a/dlls/krnl386.exe16/file.c
+++ b/dlls/krnl386.exe16/file.c
@@ -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 );
More information about the wine-cvs
mailing list