From: Vsevolod Stakhov Date: Wed, 7 Jul 2021 16:38:04 +0000 (+0100) Subject: [Minor] Fix off-by-one read X-Git-Tag: 3.0~197 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2367a70d32a34ae044c209a76eafe605a820ae81;p=thirdparty%2Frspamd.git [Minor] Fix off-by-one read --- diff --git a/src/libserver/html/html_entities.cxx b/src/libserver/html/html_entities.cxx index 0d5b7d4de4..9ed080d4f9 100644 --- a/src/libserver/html/html_entities.cxx +++ b/src/libserver/html/html_entities.cxx @@ -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;