Check type before casting

This commit is contained in:
twangboy 2017-10-19 18:52:37 -06:00
parent 03fa37b445
commit 1b12acd303
No known key found for this signature in database
GPG key ID: 93FF3BDEB278C9EB

View file

@ -589,7 +589,8 @@ def set_value(hive,
4: int, # REG_DWORD
7: list, # REG_MULTI_SZ
11: int} # REG_QWORD (unsupported)
local_vdata = reg_type[vtype_value](local_vdata)
if not isinstance(local_vdata, reg_type[vtype_value]):
local_vdata = reg_type[vtype_value](local_vdata)
if volatile:
create_options = registry.opttype['REG_OPTION_VOLATILE']