From: Lennart Poettering Date: Wed, 9 Nov 2005 01:49:51 +0000 (+0000) Subject: make sure that the local hostname passes the avahi_is_valid_domain_name() check. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=22286fca86d08ae7ccb270009997391563360e10;p=catta make sure that the local hostname passes the avahi_is_valid_domain_name() check. git-svn-id: file:///home/lennart/svn/public/avahi/trunk@940 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe --- diff --git a/avahi-core/domain-util.c b/avahi-core/domain-util.c index f541226..ab1ec8d 100644 --- a/avahi-core/domain-util.c +++ b/avahi-core/domain-util.c @@ -72,6 +72,9 @@ char *avahi_get_host_name(char *ret_s, size_t size) { if (*ret_s == 0) snprintf(ret_s, size, "unnamed"); } + + if (size >= AVAHI_LABEL_MAX) + ret_s[AVAHI_LABEL_MAX-1] = 0; return ret_s; }