Use memmove() instead of memcpy() on areas that may overlap.
[openssl.git] / ssl / t1_enc.c
index 26496d709dfff138cbb3212118bb311758ac341d..5f0976f9e7a9983e8176edf56d7ca1a9db195f10 100644 (file)
@@ -464,7 +464,7 @@ int tls1_enc(SSL *s, int send)
        if ((s->session == NULL) || (ds == NULL) ||
                (enc == NULL))
                {
-               memcpy(rec->data,rec->input,rec->length);
+               memmove(rec->data,rec->input,rec->length);
                rec->input=rec->data;
                }
        else
@@ -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"); }