Gerald Pfeifer : ntdll: Avoid a case of shift overflow in get_cpuinfo.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 27 11:06:36 CDT 2015


Module: wine
Branch: master
Commit: a7f124ae31698248ef76af57af32822baffebd90
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a7f124ae31698248ef76af57af32822baffebd90

Author: Gerald Pfeifer <gerald at pfeifer.com>
Date:   Mon Oct 26 23:00:14 2015 +0100

ntdll: Avoid a case of shift overflow in get_cpuinfo.

Signed-off-by: Gerald Pfeifer <gerald at pfeifer.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ntdll/nt.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/ntdll/nt.c b/dlls/ntdll/nt.c
index 0bcc8b0..d2ed9c5 100644
--- a/dlls/ntdll/nt.c
+++ b/dlls/ntdll/nt.c
@@ -1002,7 +1002,7 @@ static inline void get_cpuinfo(SYSTEM_CPU_INFORMATION* info)
                 user_shared_data->ProcessorFeatures[PF_VIRT_FIRMWARE_ENABLED]        = (regs2[2] >> 2) & 1;
                 user_shared_data->ProcessorFeatures[PF_NX_ENABLED]                   = (regs2[3] >> 20) & 1;
                 user_shared_data->ProcessorFeatures[PF_3DNOW_INSTRUCTIONS_AVAILABLE] = (regs2[3] >> 31) & 1;
-                if(regs2[3] & (1 << 31)) info->FeatureSet |= CPU_FEATURE_3DNOW;
+                if (regs2[3] >> 31) info->FeatureSet |= CPU_FEATURE_3DNOW;
             }
         }
         else if (regs[1] == GENU && regs[3] == INEI && regs[2] == NTEL)




More information about the wine-cvs mailing list