Re: [PATCH obexd] pbap: Fix NULL check rutine

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux