* [PATCH] return value checking of e_book_async_get_contacts() was wrong.
@ 2010-08-09 20:43 Marcel Mol
2010-08-09 20:55 ` Johan Hedberg
0 siblings, 1 reply; 2+ messages in thread
From: Marcel Mol @ 2010-08-09 20:43 UTC (permalink / raw)
To: linux-bluetooth
phonebook_create_cache() failed because checking the return value
e_book_async_get_contacts() was wrong. This would lead to a core dump
as the data was freed but was still used in the callbacks.
---
plugins/phonebook-ebook.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/plugins/phonebook-ebook.c b/plugins/phonebook-ebook.c
index 3c24107..1598d5f 100644
--- a/plugins/phonebook-ebook.c
+++ b/plugins/phonebook-ebook.c
@@ -459,7 +459,7 @@ int phonebook_create_cache(const char *name, phonebook_entry_cb entry_cb,
ret = e_book_async_get_contacts(ebook, query, cache_cb, data);
e_book_query_unref(query);
- if (ret == FALSE) {
+ if (ret != FALSE) {
g_free(data);
return -EFAULT;
}
--
1.7.2
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] return value checking of e_book_async_get_contacts() was wrong.
2010-08-09 20:43 [PATCH] return value checking of e_book_async_get_contacts() was wrong Marcel Mol
@ 2010-08-09 20:55 ` Johan Hedberg
0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2010-08-09 20:55 UTC (permalink / raw)
To: Marcel Mol; +Cc: linux-bluetooth
Hi Marcel,
On Mon, Aug 09, 2010, Marcel Mol wrote:
> phonebook_create_cache() failed because checking the return value
> e_book_async_get_contacts() was wrong. This would lead to a core dump
> as the data was freed but was still used in the callbacks.
> ---
> plugins/phonebook-ebook.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/plugins/phonebook-ebook.c b/plugins/phonebook-ebook.c
> index 3c24107..1598d5f 100644
> --- a/plugins/phonebook-ebook.c
> +++ b/plugins/phonebook-ebook.c
> @@ -459,7 +459,7 @@ int phonebook_create_cache(const char *name, phonebook_entry_cb entry_cb,
>
> ret = e_book_async_get_contacts(ebook, query, cache_cb, data);
> e_book_query_unref(query);
> - if (ret == FALSE) {
> + if (ret != FALSE) {
> g_free(data);
> return -EFAULT;
> }
Thanks for catching this. The patch is now upstream.
Johan
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-08-09 20:55 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-08-09 20:43 [PATCH] return value checking of e_book_async_get_contacts() was wrong Marcel Mol
2010-08-09 20:55 ` Johan Hedberg
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox