cryptlib.c: fix logical error.
authorAndy Polyakov <appro@openssl.org>
Sat, 1 Dec 2012 18:24:20 +0000 (18:24 +0000)
committerAndy Polyakov <appro@openssl.org>
Sat, 1 Dec 2012 18:24:20 +0000 (18:24 +0000)
crypto/cryptlib.c

index 28bc254fab598044b38e821e4180fc117f198af3..14453491deb15daff06b65b9f1aed93940869788 100644 (file)
@@ -152,13 +152,16 @@ void OPENSSL_cpuid_setup(void)
        if (!sscanf(env+off,"%lli",(long long *)&vec)) vec = strtoul(env+off,NULL,0);
 #endif
        if (off) vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P)&~vec;
+       else if (env[0]==':') vec = OPENSSL_ia32_cpuid(OPENSSL_ia32cap_P);
 
        OPENSSL_ia32cap_P[2] = 0;
        if ((env=strchr(env,':'))) {
-           off = (env[1]=='~')?2:1;
-           vec = strtoul(env+off,NULL,0);
-           if (off>1)  OPENSSL_ia32cap_P[2] &= ~vec;
-           else        OPENSSL_ia32cap_P[2] = vec;
+           unsigned int vecx;
+           env++;
+           off = (env[0]=='~')?1:0;
+           vecx = strtoul(env+off,NULL,0);
+           if (off)    OPENSSL_ia32cap_P[2] &= ~vecx;
+           else        OPENSSL_ia32cap_P[2] = vecx;
        }
     }
     else