linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fix NULL checking for pbap_get
@ 2010-08-03  9:49 Radoslaw Jablonski
  2010-08-03  9:54 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: Radoslaw Jablonski @ 2010-08-03  9:49 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Radoslaw Jablonski

Fixed NULL checking for name parameter - it shouldn't be there because
handling for NULL name for some cases is already below. Also passing path
which is NULL further makes no sense for PBAP so leaving with -EBADR if
that kind of situation occurs after generating path.
---
 plugins/pbap.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/plugins/pbap.c b/plugins/pbap.c
index 7422a1e..c008e95 100644
--- a/plugins/pbap.c
+++ b/plugins/pbap.c
@@ -555,7 +555,7 @@ static int pbap_get(struct obex_session *os, obex_object_t *obj,
 
 	DBG("name %s type %s pbap %p", name, type, pbap);
 
-	if (type == NULL || name == NULL)
+	if (type == NULL)
 		return -EBADR;
 
 	rsize = obex_aparam_read(os, obj, &buffer);
@@ -594,6 +594,9 @@ static int pbap_get(struct obex_session *os, obex_object_t *obj,
 	} else
 		return -EBADR;
 
+	if (path == NULL)
+		return -EBADR;
+
 	pbap->params = params;
 	ret = obex_get_stream_start(os, path);
 
-- 
1.7.0.4


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

* Re: [PATCH] Fix NULL checking for pbap_get
  2010-08-03  9:49 [PATCH] Fix NULL checking for pbap_get Radoslaw Jablonski
@ 2010-08-03  9:54 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2010-08-03  9:54 UTC (permalink / raw)
  To: Radoslaw Jablonski; +Cc: linux-bluetooth

Hi Radek,

On Tue, Aug 03, 2010, Radoslaw Jablonski wrote:
> Fixed NULL checking for name parameter - it shouldn't be there because
> handling for NULL name for some cases is already below. Also passing path
> which is NULL further makes no sense for PBAP so leaving with -EBADR if
> that kind of situation occurs after generating path.
> ---
>  plugins/pbap.c |    5 ++++-
>  1 files changed, 4 insertions(+), 1 deletions(-)

Thanks. The patch is now upstream.

Johan

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

end of thread, other threads:[~2010-08-03  9:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-03  9:49 [PATCH] Fix NULL checking for pbap_get Radoslaw Jablonski
2010-08-03  9:54 ` 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).