Browse Source

Fix: Segfault when path == NULL

Christian von Arnim 5 years ago
parent
commit
7511883913
1 changed files with 1 additions and 1 deletions
  1. 1 1
      src/server/ua_server_discovery_mdns.c

+ 1 - 1
src/server/ua_server_discovery_mdns.c

@@ -341,7 +341,7 @@ setTxt(UA_Server *server, const struct resource *r,
     char *path = (char *) xht_get(x, "path");
     char *caps = (char *) xht_get(x, "caps");
 
-    size_t pathLen = strlen(path);
+    size_t pathLen = path ? strlen(path) : 0;
 
     if(path && pathLen > 1) {
         if(!entry->srvSet) {