Use memmove() instead of memcpy() on areas that may overlap.
authorRichard Levitte <levitte@openssl.org>
Thu, 7 Jun 2001 04:45:55 +0000 (04:45 +0000)
committerRichard Levitte <levitte@openssl.org>
Thu, 7 Jun 2001 04:45:55 +0000 (04:45 +0000)
Spotted by Nalin Dahyabhai <nalin@redhat.com>

ssl/s3_enc.c
ssl/t1_enc.c

index 9f52c39ca978970ef65bc0baf0fe0e90e603ac83..455a6f3d06003505ff46e322a5d21522ce17ce6d 100644 (file)
@@ -356,7 +356,7 @@ int ssl3_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
index d10a23af8eb5352e9b1d30d86fd7410689560b43..18e98602bc9b9f5f2ddb8befddb714132a9d1da4 100644 (file)
@@ -420,7 +420,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