From e2b74c4be6cd9f72e03534b21211d0d2775197c2 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 18 Oct 2010 17:18:49 +0300 Subject: [PATCH] obexd: Fix possible invalid read ==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) --- obexd/src/mimetype.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/obexd/src/mimetype.c b/obexd/src/mimetype.c index 4a30222b3..078d97c58 100644 --- a/obexd/src/mimetype.c +++ b/obexd/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; -- 2.47.3