From f49dcc25e4248232c1809d79a877463078f5e987 Mon Sep 17 00:00:00 2001 From: pfg Date: Mon, 29 Dec 2014 22:54:28 +0000 Subject: [PATCH] MFC r276228: gas: use memmove instead of bogus memcpy. partial_where points into the buffer that begins with buffer_start so we need to use memmove() to handle the overlap. Fixes Sourceware-PR 11456. Obtained from: OpenBSD (CVS rev. 1.2) git-svn-id: svn://svn.freebsd.org/base/stable/10@276384 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- contrib/binutils/gas/input-scrub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/binutils/gas/input-scrub.c b/contrib/binutils/gas/input-scrub.c index 5698a6dc2..6eb01898b 100644 --- a/contrib/binutils/gas/input-scrub.c +++ b/contrib/binutils/gas/input-scrub.c @@ -335,7 +335,7 @@ input_scrub_next_buffer (char **bufp) if (partial_size) { - memcpy (buffer_start + BEFORE_SIZE, partial_where, + memmove (buffer_start + BEFORE_SIZE, partial_where, (unsigned int) partial_size); memcpy (buffer_start + BEFORE_SIZE, save_source, AFTER_SIZE); } -- 2.45.0