All of lore.kernel.org
 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

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

src is not used anymore.
---
 src/profile.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/src/profile.c b/src/profile.c
index b98db36..a085ab2 100644
--- a/src/profile.c
+++ b/src/profile.c
@@ -763,11 +763,9 @@ static void ext_connect(GIOChannel *io, GError *err, gpointer user_data)
 	struct ext_io *conn = user_data;
 	struct ext_profile *ext = conn->ext;
 	GError *io_err = NULL;
-	bdaddr_t src;
 	char addr[18];
 
 	if (!bt_io_get(io, &io_err,
-				BT_IO_OPT_SOURCE_BDADDR, &src,
 				BT_IO_OPT_DEST, addr,
 				BT_IO_OPT_INVALID)) {
 		error("Unable to get connect data for %s: %s", ext->name,
-- 
1.7.9.5


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

* Re: [PATCH 1/2] profile: Fix possible NULL pointer dereference
  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 ` Johan Hedberg
  1 sibling, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2012-12-04 11:25 UTC (permalink / raw)
  To: Szymon Janc; +Cc: linux-bluetooth

Hi Szymon,

On Tue, Dec 04, 2012, Szymon Janc wrote:
> If send_new_connection failed NULL err pointer would be dereferenced.
> ---
>  src/profile.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Both patches have been applied. Thanks.

Johan

^ permalink raw reply	[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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.