summaryrefslogtreecommitdiffstats
path: root/avahi-core
diff options
context:
space:
mode:
Diffstat (limited to 'avahi-core')
-rw-r--r--avahi-core/domain-util.c3
1 files changed, 3 insertions, 0 deletions
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;
}