From 4fb2b3c3aa8f7584a12eefce1b86f76a5f035152 Mon Sep 17 00:00:00 2001 From: Nikos 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(-) (limited to 'src') 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