Linux bluetooth development
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 3/3] Fix possible invalid read
Date: Mon, 18 Oct 2010 17:18:49 +0300	[thread overview]
Message-ID: <1287411529-5806-3-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1287411529-5806-1-git-send-email-luiz.dentz@gmail.com>

From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>

==3229== Invalid read of size 4
==3229==    at 0x1D218: obex_object_set_io_flags (in /usr/lib/obex/obexd)
==3229==  Address 0x4c95e9c is 4 bytes inside a block of size 8 free'd
==3229==    at 0x4833E98: free (vg_replace_malloc.c:366)
==3229==    by 0x4910D23: g_free (gmem.c:191)
==3229==    by 0x492B8EF: g_slist_remove (gslist.c:441)
==3229==    by 0x1D15B: ??? (in /usr/lib/obex/obexd)
---
 src/mimetype.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/src/mimetype.c b/src/mimetype.c
index 4a30222..078d97c 100644
--- a/src/mimetype.c
+++ b/src/mimetype.c
@@ -50,9 +50,11 @@ void obex_object_set_io_flags(void *object, int flags, int err)
 {
 	GSList *l;
 
-	for (l = watches; l; l = l->next) {
+	for (l = watches; l;) {
 		struct io_watch *watch = l->data;
 
+		l = l->next;
+
 		if (watch->object != object)
 			continue;
 
-- 
1.7.1


  parent reply	other threads:[~2010-10-18 14:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-18 14:18 [PATCH 1/3] Make use of transfer->err to store transfer errors Luiz Augusto von Dentz
2010-10-18 14:18 ` [PATCH 2/3] Fix not setting proper errors when canceling suspended requests Luiz Augusto von Dentz
2010-10-18 14:18 ` Luiz Augusto von Dentz [this message]
2010-10-20  8:57 ` [PATCH 1/3] Make use of transfer->err to store transfer errors Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1287411529-5806-3-git-send-email-luiz.dentz@gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox