[REGEDIT][REG] Limit registry type to 8 hex digits when importing (#6063)

Matches Windows and lets the Wine13i test in regedit_winetest pass.
This commit is contained in:
Whindmar Saksit 2023-12-04 16:46:06 +01:00 committed by GitHub
parent 0c568c0c90
commit e4d03f471b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -276,7 +276,12 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
/* "hex(xx):" is special */
val = wcstoul(*line, &end, 16);
#ifdef __REACTOS__
/* Up to 8 hex digits, "hex(000000002)" is invalid */
if (*end != ')' || *(end + 1) != ':' || (val == ~0u && errno == ERANGE) || end - *line > 8)
#else
if (*end != ')' || *(end + 1) != ':' || (val == ~0u && errno == ERANGE))
#endif
return FALSE;
parser->data_type = val;

View file

@ -339,7 +339,12 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
/* "hex(xx):" is special */
val = wcstoul(*line, &end, 16);
#ifdef __REACTOS__
/* Up to 8 hex digits, "hex(000000002)" is invalid */
if (*end != ')' || *(end + 1) != ':' || (val == ~0u && errno == ERANGE) || end - *line > 8)
#else
if (*end != ')' || *(end + 1) != ':' || (val == ~0u && errno == ERANGE))
#endif
return FALSE;
parser->data_type = val;