From: Vsevolod Stakhov Date: Tue, 20 Sep 2016 13:04:32 +0000 (+0100) Subject: [Fix] Use memmove for overlapping regions X-Git-Tag: 1.4.0~404 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=9ac183e4ae31c1a5637dc371fbfff53a9adb2531;p=rspamd.git [Fix] Use memmove for overlapping regions Issue: #961 MFH: true --- diff --git a/src/libserver/html.c b/src/libserver/html.c index b121006bb..af91ab39c 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; } }