linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] profile: Fix possible NULL pointer dereference
@ 2012-12-04 10:15 Szymon Janc
  2012-12-04 10:15 ` [PATCH 2/2] profile: Remove not local variable needed in ext_connect Szymon Janc
  2012-12-04 11:25 ` [PATCH 1/2] profile: Fix possible NULL pointer dereference Johan Hedberg
  0 siblings, 2 replies; 3+ messages in thread
From: Szymon Janc @ 2012-12-04 10:15 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Szymon Janc

If send_new_connection failed NULL err pointer would be dereferenced.
---
 src/profile.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/profile.c b/src/profile.c
index c9ff553..b98db36 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -800,7 +800,7 @@ static void ext_connect(GIOChannel *io, GError *err, gpointer user_data)
 
 drop:
 	if (conn->cb) {
-		conn->cb(&ext->p, conn->device, -err->code);
+		conn->cb(&ext->p, conn->device, err ? -err->code : -EIO);
 		conn->cb = NULL;
 	}
 	if (io_err)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-12-04 11:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-04 10:15 [PATCH 1/2] profile: Fix possible NULL pointer dereference Szymon Janc
2012-12-04 10:15 ` [PATCH 2/2] profile: Remove not local variable needed in ext_connect Szymon Janc
2012-12-04 11:25 ` [PATCH 1/2] profile: Fix possible NULL pointer dereference Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).