]> git.meshlink.io Git - catta/commitdiff
make sure that the local hostname passes the avahi_is_valid_domain_name() check.
authorLennart Poettering <lennart@poettering.net>
Wed, 9 Nov 2005 01:49:51 +0000 (01:49 +0000)
committerLennart Poettering <lennart@poettering.net>
Wed, 9 Nov 2005 01:49:51 +0000 (01:49 +0000)
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@940 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe

avahi-core/domain-util.c

index f5412264c20ea3382cd4432c30739ecfef628847..ab1ec8d0c51dd92100d8f5fb211c512b7c2d9a16 100644 (file)
@@ -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;
 }