forked from Mirrors/wine-wine
regedit: Fail when parsing any hex data type that is greater than ULONG_MAX on Windows.
Signed-off-by: Hugh McMaster <hugh.mcmaster@outlook.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>oldstable
parent
c0312bf79e
commit
8803b9616b
|
@ -21,6 +21,7 @@
|
||||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <errno.h>
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
@ -319,8 +320,8 @@ static BOOL parse_data_type(struct parser *parser, WCHAR **line)
|
||||||
DWORD val;
|
DWORD val;
|
||||||
|
|
||||||
/* "hex(xx):" is special */
|
/* "hex(xx):" is special */
|
||||||
val = strtoulW(*line, &end, 16);
|
val = wcstoul(*line, &end, 16);
|
||||||
if (!**line || *end != ')' || *(end + 1) != ':')
|
if (!**line || *end != ')' || *(end + 1) != ':' || (val == ~0u && errno == ERANGE))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
parser->data_type = val;
|
parser->data_type = val;
|
||||||
|
|
|
@ -464,7 +464,7 @@ static void test_basic_import(void)
|
||||||
verify_reg(hkey, "Wine13f", 0xffff, "Value", 6, 0);
|
verify_reg(hkey, "Wine13f", 0xffff, "Value", 6, 0);
|
||||||
verify_reg(hkey, "Wine13g", 0x7fffffff, "Value", 6, 0);
|
verify_reg(hkey, "Wine13g", 0x7fffffff, "Value", 6, 0);
|
||||||
verify_reg(hkey, "Wine13h", 0xffffffff, "Value", 6, 0);
|
verify_reg(hkey, "Wine13h", 0xffffffff, "Value", 6, 0);
|
||||||
todo_wine verify_reg_nonexist(hkey, "Wine13i");
|
verify_reg_nonexist(hkey, "Wine13i");
|
||||||
|
|
||||||
RegCloseKey(hkey);
|
RegCloseKey(hkey);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue