Fixed off by 1 error in section code (did not return len-2 on buffer

overflow in some cases, but len-1).
This commit is contained in:
Marcus Meissner 1999-05-08 18:29:10 +00:00 committed by Alexandre Julliard
parent 4a3b0e3080
commit acfae0c117

View file

@ -579,7 +579,7 @@ static INT PROFILE_GetSection( PROFILESECTION *section, LPCSTR section_name,
}
}
*buffer = '\0';
if (len < 1)
if (len <= 1)
/*If either lpszSection or lpszKey is NULL and the supplied
destination buffer is too small to hold all the strings,
the last string is truncated and followed by two null characters.