This change should be suitable as a workaround for the Solaris x86
authorBodo Möller <bodo@openssl.org>
Tue, 3 Apr 2001 13:50:30 +0000 (13:50 +0000)
committerBodo Möller <bodo@openssl.org>
Tue, 3 Apr 2001 13:50:30 +0000 (13:50 +0000)
compiler bug reported in <01032110293775.22278@weba3.iname.net>
(the '++seq[i]' condition is evaluated as 256 rather than 0
when the previous value is 255).

ssl/s3_enc.c
ssl/t1_enc.c

index ad367c0e744a62397646f498c72c66f390604c61..9e442a1f1bf2c95d29f9764efa082f881ebdd7d3 100644 (file)
@@ -504,7 +504,10 @@ int ssl3_mac(SSL *ssl, unsigned char *md, int send)
        EVP_DigestFinal( &md_ctx,md,&md_size);
 
        for (i=7; i>=0; i--)
-               if (++seq[i]) break; 
+               {
+               ++seq[i];
+               if (seq[i] != 0) break; 
+               }
 
        return(md_size);
        }
index 26496d709dfff138cbb3212118bb311758ac341d..3077e9b9b9dd357ce6c70bcccfe207b98d65f331 100644 (file)
@@ -643,7 +643,10 @@ printf("rec=");
 #endif
 
        for (i=7; i>=0; i--)
-               if (++seq[i]) break; 
+               {
+               ++seq[i];
+               if (seq[i] != 0) break; 
+               }
 
 #ifdef TLS_DEBUG
 {unsigned int z; for (z=0; z<md_size; z++) printf("%02X ",md[z]); printf("\n"); }