mirror of
https://github.com/reactos/reactos.git
synced 2025-05-17 16:27:00 +00:00
[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:
parent
9adb79a0d9
commit
1a9d9f441c
3 changed files with 7 additions and 4 deletions
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue