diff options
author | Bharat Panda <bharat.panda@samsung.com> | 2015-03-20 12:05:08 +0530 |
---|---|---|
committer | Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | 2015-03-20 15:37:40 +0200 |
commit | 982b9c322e11fa86777eb21fa256176ace8f0736 (patch) | |
tree | 39f99ab07d3c1fa031f553d536fc14a1cc2d4132 | |
parent | 5cd26f3366c3d0c1c0bb873e49fd6ea9d0044e2a (diff) | |
download | bluez-982b9c322e11fa86777eb21fa256176ace8f0736.tar.gz |
obexd/pbap: Fix NULL check to avoid potential crash
NULL pointer check for name is done before using the same.
-rw-r--r-- | obexd/plugins/pbap.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/obexd/plugins/pbap.c b/obexd/plugins/pbap.c index cec5acd3f..f2f916622 100644 --- a/obexd/plugins/pbap.c +++ b/obexd/plugins/pbap.c @@ -728,6 +728,11 @@ static void *vobject_list_open(const char *name, int oflag, mode_t mode, int ret; void *request; + if (name == NULL) { + ret = -EBADR; + goto fail; + } + DBG("name %s context %p valid %d", name, context, pbap->cache.valid); if (oflag != O_RDONLY) { @@ -735,11 +740,6 @@ static void *vobject_list_open(const char *name, int oflag, mode_t mode, goto fail; } - if (name == NULL) { - ret = -EBADR; - goto fail; - } - /* PullvCardListing always get the contacts from the cache */ if (pbap->cache.valid) { |