Author: hpoussin
Date: Sun May 7 13:32:56 2006
New Revision: 21823
URL:
http://svn.reactos.ru/svn/reactos?rev=21823&view=rev
Log:
Fix buffer overflow (spotted by Detlef Riekenberg in wine-devel ML)
Modified:
trunk/reactos/dll/win32/setupapi/parser.c
Modified: trunk/reactos/dll/win32/setupapi/parser.c
URL:
http://svn.reactos.ru/svn/reactos/trunk/reactos/dll/win32/setupapi/parser.c…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/parser.c (original)
+++ trunk/reactos/dll/win32/setupapi/parser.c Sun May 7 13:32:56 2006
@@ -953,10 +953,10 @@
else
{
WCHAR *new_buff = (WCHAR *)buffer;
- /* Some UNICODE files may start with the UNICODE marker */
+ /* UCS-16 files should start with the Unicode BOM; we should skip it */
if (*new_buff == 0xfeff)
new_buff++;
- err = parse_buffer( file, new_buff, (WCHAR *)((char *)new_buff + size),
error_line );
+ err = parse_buffer( file, new_buff, (WCHAR *)((char *)buffer + size), error_line
);
}
if (!err) /* now check signature */