From 9ac183e4ae31c1a5637dc371fbfff53a9adb2531 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Tue, 20 Sep 2016 14:04:32 +0100 Subject: [PATCH] [Fix] Use memmove for overlapping regions Issue: #961 MFH: true --- src/libserver/html.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libserver/html.c b/src/libserver/html.c index b121006bbe..af91ab39cf 100644 --- a/src/libserver/html.c +++ b/src/libserver/html.c @@ -691,7 +691,7 @@ rspamd_html_decode_entitles_inplace (gchar *s, guint len) t += rep_len; } else { - memcpy (t, e, h - e); + memmove (t, e, h - e); t += h - e; } } @@ -713,7 +713,7 @@ rspamd_html_decode_entitles_inplace (gchar *s, guint len) } if (end_ptr != NULL && *end_ptr != '\0') { /* Skip undecoded */ - memcpy (t, e, h - e); + memmove (t, e, h - e); t += h - e; } else { @@ -736,7 +736,7 @@ rspamd_html_decode_entitles_inplace (gchar *s, guint len) t += g_unichar_to_utf8 (val, t); } else { - memcpy (t, e, h - e); + memmove (t, e, h - e); t += h - e; } } -- 2.47.3