[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.

svn path=/trunk/; revision=47053
This commit is contained in:
Eric Kohl 2010-04-28 11:35:34 +00:00
parent 9adb79a0d9
commit 1a9d9f441c
3 changed files with 7 additions and 4 deletions

View file

@ -3266,6 +3266,8 @@ RegistryPage(PINPUT_RECORD Ir)
DPRINT("Action: %S File: %S Section %S\n", Action, File, Section);
if (Action == NULL) break; // Hackfix
if (!_wcsicmp (Action, L"AddReg"))
{
Delete = FALSE;

View file

@ -365,7 +365,7 @@ __inline static enum parser_state set_state( struct parser *parser, enum parser_
/* 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 @@ __inline static int is_eol( struct parser *parser, const WCHAR *ptr )
return (ptr >= parser->end ||
*ptr == CONTROL_Z ||
*ptr == '\n' ||
(*ptr == '\r' && *(ptr + 1) == '\n'));
(*ptr == '\r' && *(ptr + 1) == '\n') ||
*ptr == 0);
}

View file

@ -120,7 +120,7 @@ InfOpenBufferedFile(PHINF InfHandle,
Status = InfpParseBuffer(Cache,
new_buff,
new_buff + len,
new_buff + len / sizeof(WCHAR),
ErrorLine);
FREE(new_buff);
}
@ -293,7 +293,7 @@ InfOpenFile(PHINF InfHandle,
Status = InfpParseBuffer(Cache,
new_buff,
new_buff + len,
new_buff + len / sizeof(WCHAR),
ErrorLine);
FREE(new_buff);
}