Diff between f77ed4911e01a43659d2daaa3724450489f6126b and 32e2e5a42b2b51b7a196de0b5bd199eeb5ce4725

Changed Files

File Additions Deletions Status
src/device.c +4 -0 modified
src/profile.c +2 -0 modified

Full Patch

diff --git a/src/device.c b/src/device.c
index ec97fc8..aca28af 100644
--- a/src/device.c
+++ b/src/device.c
@@ -2646,6 +2646,10 @@ static DBusMessage *connect_profile(DBusConnection *conn, DBusMessage *msg,
 	}
 
 	uuid = bt_name2string(pattern);
+	if (uuid == NULL)
+		return btd_error_invalid_args_str(msg,
+					ERR_BREDR_CONN_INVALID_ARGUMENTS);
+
 	reply = connect_profiles(dev, BDADDR_BREDR, msg, uuid);
 	free(uuid);
 
diff --git a/src/profile.c b/src/profile.c
index 9fdfb7d..ad20436 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -2319,6 +2319,8 @@ static int parse_ext_opt(struct ext_profile *ext, const char *key,
 		dbus_message_iter_get_basic(value, &str);
 		free(ext->service);
 		ext->service = bt_name2string(str);
+		if (ext->service == NULL)
+			return -EINVAL;
 	}
 
 	return 0;