This change should be suitable as a workaround for the Solaris x86
authorBodo Möller <bodo@openssl.org>
Tue, 3 Apr 2001 13:46:36 +0000 (13:46 +0000)
committerBodo Möller <bodo@openssl.org>
Tue, 3 Apr 2001 13:46:36 +0000 (13:46 +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 012a4b8740772e56241f03013cb97cc0e5a18503..9f52c39ca978970ef65bc0baf0fe0e90e603ac83 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 0d34357eb474e58238c3c499aa61c4f3e6962527..d10a23af8eb5352e9b1d30d86fd7410689560b43 100644 (file)
@@ -572,7 +572,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"); }