linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH obexd v2 0/1] Fix invalid memory read when pulling phone book
@ 2011-07-07 12:01 Dmitriy Paliy
  2011-07-07 12:01 ` [PATCH obexd v2] " Dmitriy Paliy
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitriy Paliy @ 2011-07-07 12:01 UTC (permalink / raw)
  To: linux-bluetooth, radoslawjablonski

Hi,

This patch is updated w.r.t. to Radek's comment.

BR,
Dmitriy


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH obexd v2] Fix invalid memory read when pulling phone book
  2011-07-07 12:01 [PATCH obexd v2 0/1] Fix invalid memory read when pulling phone book Dmitriy Paliy
@ 2011-07-07 12:01 ` Dmitriy Paliy
  2011-07-10  7:49   ` Johan Hedberg
  0 siblings, 1 reply; 3+ messages in thread
From: Dmitriy Paliy @ 2011-07-07 12:01 UTC (permalink / raw)
  To: linux-bluetooth, radoslawjablonski; +Cc: Dmitriy Paliy

Data contacts are freed ones in finalize function which is called in
query_result callback function. Calling free_data_contacts(data) twice
for last phone book part causes invalid memory read when dereferencing
data->contacts.
---
 plugins/phonebook-tracker.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/plugins/phonebook-tracker.c b/plugins/phonebook-tracker.c
index d396203..e4e7779 100644
--- a/plugins/phonebook-tracker.c
+++ b/plugins/phonebook-tracker.c
@@ -1154,7 +1154,8 @@ static void send_pull_part(struct phonebook_data *data,
 	data->cb(vcards->str, vcards->len, g_slist_length(data->contacts),
 			data->newmissedcalls, lastpart, data->user_data);
 
-	free_data_contacts(data);
+	if (!lastpart)
+		free_data_contacts(data);
 	g_string_free(vcards, TRUE);
 }
 
-- 
1.7.4.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH obexd v2] Fix invalid memory read when pulling phone book
  2011-07-07 12:01 ` [PATCH obexd v2] " Dmitriy Paliy
@ 2011-07-10  7:49   ` Johan Hedberg
  0 siblings, 0 replies; 3+ messages in thread
From: Johan Hedberg @ 2011-07-10  7:49 UTC (permalink / raw)
  To: Dmitriy Paliy; +Cc: linux-bluetooth, radoslawjablonski

Hi Dmitriy,

On Thu, Jul 07, 2011, Dmitriy Paliy wrote:
> Data contacts are freed ones in finalize function which is called in
> query_result callback function. Calling free_data_contacts(data) twice
> for last phone book part causes invalid memory read when dereferencing
> data->contacts.
> ---
>  plugins/phonebook-tracker.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

Applied. Thanks.

Johan

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-07-10  7:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-07 12:01 [PATCH obexd v2 0/1] Fix invalid memory read when pulling phone book Dmitriy Paliy
2011-07-07 12:01 ` [PATCH obexd v2] " Dmitriy Paliy
2011-07-10  7:49   ` Johan Hedberg

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).