From 22286fca86d08ae7ccb270009997391563360e10 Mon Sep 17 00:00:00 2001 From: Lennart Poettering Date: Wed, 9 Nov 2005 01:49:51 +0000 Subject: [PATCH] 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 --- avahi-core/domain-util.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.39.5