diff --git a/base/applications/cmdutils/reg/import.c b/base/applications/cmdutils/reg/import.c index 1d4e3d53536..91442cf06b3 100644 --- a/base/applications/cmdutils/reg/import.c +++ b/base/applications/cmdutils/reg/import.c @@ -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; diff --git a/base/applications/regedit/regproc.c b/base/applications/regedit/regproc.c index 1ef1fc9e6c2..f8d448e08c8 100644 --- a/base/applications/regedit/regproc.c +++ b/base/applications/regedit/regproc.c @@ -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;