diff --git a/base/applications/cmdutils/reg/import.c b/base/applications/cmdutils/reg/import.c index f7f87939e2..e2a33cd53c 100644 --- a/base/applications/cmdutils/reg/import.c +++ b/base/applications/cmdutils/reg/import.c @@ -285,6 +285,12 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line) /* "hex(xx):" is special */ val = wcstoul(*line, &end, 16); + /* We cannot handle more that 8 characters here, so return FALSE. + * Since errno is only implemented as a stub, + * we cannot depend upon it working correctly below. */ + /* FIXME: This can be removed when errno is implemented. */ + if ((ULONG)(end - *line) > 8) + return FALSE; if (*end != ')' || *(end + 1) != ':' || (val == ~0u && errno == ERANGE)) return FALSE;