From 1bbb7089c3f2190a206cc981235287333cca44f5 Mon Sep 17 00:00:00 2001 From: Nokis Mavrogiannopoulos Date: Sun, 14 Sep 2008 16:40:15 +0000 Subject: use memmove instead of memcpy because buffers might overlap. --- src/gnutls_io.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gnutls_io.c b/src/gnutls_io.c index 753c87b..1505666 100644 --- a/src/gnutls_io.c +++ b/src/gnutls_io.c @@ -72,13 +72,13 @@ static int char_buffer_read(mgs_char_buffer_t * buffer, char *in, if (buffer->length > inl) { /* we have have enough to fill the caller's buffer */ - memcpy(in, buffer->value, inl); + memmove(in, buffer->value, inl); buffer->value += inl; buffer->length -= inl; } else { /* swallow remainder of the buffer */ - memcpy(in, buffer->value, buffer->length); + memmove(in, buffer->value, buffer->length); inl = buffer->length; buffer->value = NULL; buffer->length = 0; -- cgit