reg: Fix test failures on 64-bit operating systems

Hugh McMaster hugh.mcmaster at outlook.com
Thu Aug 18 04:59:53 CDT 2016


Signed-off-by: Hugh McMaster <hugh.mcmaster at outlook.com>
---
 programs/reg/reg.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/programs/reg/reg.c b/programs/reg/reg.c
index 6fcf129..6522fe6 100644
--- a/programs/reg/reg.c
+++ b/programs/reg/reg.c
@@ -249,9 +249,9 @@ static LPBYTE get_regdata(const WCHAR *data, DWORD reg_type, WCHAR separator, DW
         case REG_DWORD_BIG_ENDIAN: /* Yes, this is correct! */
         {
             LPWSTR rest;
-            DWORD val;
+            unsigned long val;
             val = strtoulW(data, &rest, (tolowerW(data[1]) == 'x') ? 16 : 10);
-            if (*rest || data[0] == '-' || (val == ~0u && errno == ERANGE)) {
+            if (*rest || data[0] == '-' || (val == ~0u && errno == ERANGE) || val > ~0u) {
                 output_message(STRING_MISSING_INTEGER);
                 break;
             }
-- 
2.7.4




More information about the wine-patches mailing list