commit d92a8ab188823edb95760c128af3bfc1b7173263 parent f6815a5493265e271665bb92e50816afa17a874e Author: Andrej Kacian <ticho@claws-mail.org> Date: Sun, 27 Jan 2019 10:50:22 +0100 Make is_toplvl_domain() aware that TLDs can be longer than 6 characters Diffstat:
| M | src/common/utils.c | | | 7 | +++---- |
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/common/utils.c b/src/common/utils.c @@ -3491,12 +3491,11 @@ static GHashTable *create_domain_tab(void) static gboolean is_toplvl_domain(GHashTable *tab, const gchar *first, const gchar *last) { - const gint MAX_LVL_DOM_NAME_LEN = 6; - gchar buf[MAX_LVL_DOM_NAME_LEN + 1]; - const gchar *m = buf + MAX_LVL_DOM_NAME_LEN + 1; + gchar buf[BUFFSIZE + 1]; + const gchar *m = buf + BUFFSIZE + 1; register gchar *p; - if (last - first > MAX_LVL_DOM_NAME_LEN || first > last) + if (last - first > BUFFSIZE || first > last) return FALSE; for (p = buf; p < m && first < last; *p++ = *first++)