talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 577c2d3a4da4238b43f9aa4bcb6c9363b61748dc
parent b53607c2fa9977c33ba77e237be7550353396b8e
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:
Msrc/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++)