readline: avoid memcpy() of overlapping regions
commit7682e8580722f951559f372ba3d2b6170fdbe734
authorNickolai Zeldovich <nickolai@csail.mit.edu>
Mon, 7 Jan 2013 20:38:39 +0000 (7 15:38 -0500)
committerStefan Hajnoczi <stefanha@redhat.com>
Tue, 8 Jan 2013 09:00:26 +0000 (8 10:00 +0100)
tree204b296a188a9ab4caedb029191b3e5904f52eff
parent8e4a424b305e29dc0e454f52df3b35577f342975
readline: avoid memcpy() of overlapping regions

memcpy() for overlapping regions is undefined behavior; use memmove()
instead in readline_hist_add().

[Keep tab characters since surrounding code still uses them -- Stefan]

Signed-off-by: Nickolai Zeldovich <nickolai@csail.mit.edu>
Reviewed-by: Richard Henderson <rth@twiddle.net>
Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
readline.c