From 2367a70d32a34ae044c209a76eafe605a820ae81 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Wed, 7 Jul 2021 17:38:04 +0100 Subject: [PATCH] [Minor] Fix off-by-one read --- src/libserver/html/html_entities.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libserver/html/html_entities.cxx b/src/libserver/html/html_entities.cxx index 0d5b7d4de..9ed080d4f 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; -- 2.39.5