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

ssl/s3_enc.c
ssl/t1_enc.c

index b27e9562b96cb2580c99013ecb415237fa1b1897..8cd36a395c8b5fe4f89672c1801a04f3dc2f4b86 100644 (file)
@@ -363,7 +363,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 3077e9b9b9dd357ce6c70bcccfe207b98d65f331..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