]> source.dussan.org Git - rspamd.git/commitdiff
[Fix] Use memmove for overlapping regions
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Sep 2016 13:04:32 +0000 (14:04 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Tue, 20 Sep 2016 13:05:38 +0000 (14:05 +0100)
Issue: #961
MFH: true

src/libserver/html.c

index b121006bbe5c059dda2a35cc9f7761182bb23568..af91ab39cff8dd44ffe9626a1238e72a37d3b49d 100644 (file)
@@ -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;
                                                        }
                                                }