Author: ekohl
Date: Wed Apr 28 13:35:34 2010
New Revision: 47053
URL:
http://svn.reactos.org/svn/reactos?rev=47053&view=rev
Log:
[MKHIVE/USETUP]
- Fix buffer size calculation for the parser.
- Do not try to execute an empty registry instruction
Patches by Roel Messiant.
- Stop the parser at the first NULL character.
Patch by me.
Modified:
trunk/reactos/base/setup/usetup/interface/usetup.c
trunk/reactos/lib/newinflib/infcore.c
trunk/reactos/lib/newinflib/infrosgen.c
Modified: trunk/reactos/base/setup/usetup/interface/usetup.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/setup/usetup/interfac…
==============================================================================
--- trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] (original)
+++ trunk/reactos/base/setup/usetup/interface/usetup.c [iso-8859-1] Wed Apr 28 13:35:34
2010
@@ -3266,6 +3266,8 @@
DPRINT("Action: %S File: %S Section %S\n", Action, File, Section);
+ if (Action == NULL) break; // Hackfix
+
if (!_wcsicmp (Action, L"AddReg"))
{
Delete = FALSE;
Modified: trunk/reactos/lib/newinflib/infcore.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/newinflib/infcore.c?re…
==============================================================================
--- trunk/reactos/lib/newinflib/infcore.c [iso-8859-1] (original)
+++ trunk/reactos/lib/newinflib/infcore.c [iso-8859-1] Wed Apr 28 13:35:34 2010
@@ -365,7 +365,7 @@
/* check if the pointer points to an end of file */
__inline static int is_eof( struct parser *parser, const WCHAR *ptr )
{
- return (ptr >= parser->end || *ptr == CONTROL_Z);
+ return (ptr >= parser->end || *ptr == CONTROL_Z || *ptr == 0);
}
@@ -375,7 +375,8 @@
return (ptr >= parser->end ||
*ptr == CONTROL_Z ||
*ptr == '\n' ||
- (*ptr == '\r' && *(ptr + 1) == '\n'));
+ (*ptr == '\r' && *(ptr + 1) == '\n') ||
+ *ptr == 0);
}
Modified: trunk/reactos/lib/newinflib/infrosgen.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/lib/newinflib/infrosgen.c?…
==============================================================================
--- trunk/reactos/lib/newinflib/infrosgen.c [iso-8859-1] (original)
+++ trunk/reactos/lib/newinflib/infrosgen.c [iso-8859-1] Wed Apr 28 13:35:34 2010
@@ -120,7 +120,7 @@
Status = InfpParseBuffer(Cache,
new_buff,
- new_buff + len,
+ new_buff + len / sizeof(WCHAR),
ErrorLine);
FREE(new_buff);
}
@@ -293,7 +293,7 @@
Status = InfpParseBuffer(Cache,
new_buff,
- new_buff + len,
+ new_buff + len / sizeof(WCHAR),
ErrorLine);
FREE(new_buff);
}