* [PATCH obexd] pbap: Fix NULL check rutine
@ 2011-12-20 7:27 DoHyun Pyun
2011-12-20 8:29 ` DoHyun Pyun
0 siblings, 1 reply; 2+ messages in thread
From: DoHyun Pyun @ 2011-12-20 7:27 UTC (permalink / raw)
To: linux-bluetooth; +Cc: DoHyun Pyun
If obj->buffer is NULL, we should exit the function.
Because the crash will be occured in string_read() function.
THe previous statement returns the error when both obj->buffer and obj->aparams is NULL.
---
plugins/pbap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/plugins/pbap.c b/plugins/pbap.c
index 0f07c46..e642599 100644
--- a/plugins/pbap.c
+++ b/plugins/pbap.c
@@ -996,7 +996,7 @@ static ssize_t vobject_pull_read(void *object, void *buf, size_t count)
DBG("buffer %p maxlistcount %d", obj->buffer,
pbap->params->maxlistcount);
- if (!obj->buffer && !obj->aparams)
+ if (!obj->buffer || !obj->aparams)
return -EAGAIN;
if (pbap->params->maxlistcount == 0)
--
1.7.4.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH obexd] pbap: Fix NULL check rutine
2011-12-20 7:27 [PATCH obexd] pbap: Fix NULL check rutine DoHyun Pyun
@ 2011-12-20 8:29 ` DoHyun Pyun
0 siblings, 0 replies; 2+ messages in thread
From: DoHyun Pyun @ 2011-12-20 8:29 UTC (permalink / raw)
To: linux-bluetooth
Hi, All
2011/12/20 16:27, DoHyun Pyun wrote:
> If obj->buffer is NULL, we should exit the function.
> Because the crash will be occured in string_read() function.
>
> THe previous statement returns the error when both obj->buffer and obj->aparams is NULL.
> ---
> plugins/pbap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/plugins/pbap.c b/plugins/pbap.c
> index 0f07c46..e642599 100644
> --- a/plugins/pbap.c
> +++ b/plugins/pbap.c
> @@ -996,7 +996,7 @@ static ssize_t vobject_pull_read(void *object, void *buf, size_t count)
> DBG("buffer %p maxlistcount %d", obj->buffer,
> pbap->params->maxlistcount);
>
> - if (!obj->buffer&& !obj->aparams)
> + if (!obj->buffer || !obj->aparams)
> return -EAGAIN;
>
> if (pbap->params->maxlistcount == 0)
I found some problems in this patch, and I will re-write the patch.
So please ignore this patch.
Thanks,
Pyun
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-12-20 8:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-20 7:27 [PATCH obexd] pbap: Fix NULL check rutine DoHyun Pyun
2011-12-20 8:29 ` DoHyun Pyun
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).