From 14d11b28e496de5c7bcef0f9f352387173c87bde Mon Sep 17 00:00:00 2001 From: Radoslaw Jablonski Date: Tue, 3 Aug 2010 12:49:47 +0300 Subject: [PATCH] obexd: Fix NULL checking for pbap_get 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. --- obexd/plugins/pbap.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c index 7422a1e2d..c008e951d 100644 --- a/obexd/plugins/pbap.c +++ b/obexd/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); -- 2.47.3