Diff between 7ce093041a19b7195ddab6940e62587edc7b99ea and f0106d92a1e04950a1ddd28fbcdb480cbd050d43

Changed Files

File Additions Deletions Status
src/advertising.c +9 -1 modified

Full Patch

diff --git a/src/advertising.c b/src/advertising.c
index 2110f17..ca23774 100644
--- a/src/advertising.c
+++ b/src/advertising.c
@@ -533,7 +533,15 @@ static bool parse_local_name(DBusMessageIter *iter,
 	dbus_message_iter_get_basic(iter, &name);
 
 	free(client->name);
-	client->name = strdup(name);
+
+	/* Treat empty string the same as omitting since there is no point on
+	 * adding a empty name as AD data as it just take space that could be
+	 * used for something else.
+	 */
+	if (name[0] != '\0')
+		client->name = strdup(name);
+	else
+		client->name = NULL;
 
 	return true;
 }