]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Fix off-by-one read
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 7 Jul 2021 16:38:04 +0000 (17:38 +0100)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 7 Jul 2021 16:38:04 +0000 (17:38 +0100)
src/libserver/html/html_entities.cxx

index 0d5b7d4de457ef9348c5a06ba0cdd15e0c3b4b6c..9ed080d4f984b9c555280257dd6fd3ee5644da90 100644 (file)
@@ -2283,9 +2283,9 @@ decode_html_entitles_inplace(char *s, std::size_t len, bool norm_spaces)
                        heuristic_lookup_func(2);
 
                        /* Leave undecoded */
-                       if (!entity_def && (end - t > h - e + 1)) {
-                               memmove(t, e, h - e + 1);
-                               t += h - e + 1;
+                       if (!entity_def && (end - t > h - e)) {
+                               memmove(t, e, h - e);
+                               t += h - e;
                        }
                        else if (entity_def) {
                                return true;