Diff between 5166b5de6720c2375518f567f7c0b13ee9444883 and c16acfd544abbd2b4b5496fee076493527234755

Changed Files

File Additions Deletions Status
obexd/client/session.c +6 -0 modified

Full Patch

diff --git a/obexd/client/session.c b/obexd/client/session.c
index d2ae4fd..a6dbcb5 100644
--- a/obexd/client/session.c
+++ b/obexd/client/session.c
@@ -1149,6 +1149,12 @@ guint obc_session_setpath(struct obc_session *session, const char *path,
 	data->user_data = user_data;
 	data->remaining = g_strsplit(strlen(path) ? path : "/", "/", 0);
 
+	if (!data->remaining || !data->remaining[0]) {
+		error("obc_session_setpath: invalid path %s", path);
+		g_set_error(err, OBEX_IO_ERROR, -EINVAL, "Invalid argument");
+		return 0;
+	}
+
 	p = pending_request_new(session, session_process_setpath, NULL,
 				setpath_op_complete, data, setpath_data_free);
 	session_queue(p);