OSDN Git Service
(root)
/
android-x86
/
external-bluetooth-bluez.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18bdb12
)
network: Fix missing NULL check for given UUID
author
Mikel Astiz
<mikel.astiz@bmw-carit.de>
Mon, 27 May 2013 12:04:05 +0000
(14:04 +0200)
committer
Johan Hedberg
<johan.hedberg@intel.com>
Mon, 24 Jun 2013 08:16:43 +0000
(11:16 +0300)
The code dereferences a NULL pointer if find_connection() doesn't find
an existing connection, which will be the case if the input UUID is
invalid or not supported.
profiles/network/connection.c
patch
|
blob
|
history
diff --git
a/profiles/network/connection.c
b/profiles/network/connection.c
index
84f3dd6
..
bac3b69
100644
(file)
--- a/
profiles/network/connection.c
+++ b/
profiles/network/connection.c
@@
-426,7
+426,10
@@
static DBusMessage *local_connect(DBusConnection *conn,
id = bnep_service_id(svc);
nc = find_connection(peer->connections, id);
- if (nc && nc->connect)
+ if (nc == NULL)
+ return btd_error_invalid_args(msg);
+
+ if (nc->connect != NULL)
return btd_error_busy(msg);
err = connection_connect(nc->service);