* [PATCH] Fix GUI crash while connecting Interlink Bluetooth Mouse in android platform.
@ 2010-10-19 9:54 Balamurugan Mahalingam
2010-10-19 11:23 ` Johan Hedberg
0 siblings, 1 reply; 3+ messages in thread
From: Balamurugan Mahalingam @ 2010-10-19 9:54 UTC (permalink / raw)
To: marcel; +Cc: linux-bluetooth, charubala, Balamurugan Mahalingam
Crash is due to some junk characters in the device name.
The device name is copied from a string variable after freeing the memory it points to, so there were some junk characters in it which was the reason for the crash.
Fixing the issue by freeing the memory in string variable after device name is copied.
Signed-off-by: Balamurugan Mahalingam <mbalamurugan@atheros.com>
---
compat/sdp.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/compat/sdp.c b/compat/sdp.c
index 8898136..ff2e39f 100644
--- a/compat/sdp.c
+++ b/compat/sdp.c
@@ -152,7 +152,6 @@ int get_stored_device_info(const bdaddr_t *src, const bdaddr_t *dst, struct hidp
&vendor, &product, &version, &subclass, &country,
&parser, desc, &req->flags, &pos);
- free(str);
req->vendor = vendor;
req->product = product;
@@ -163,6 +162,7 @@ int get_stored_device_info(const bdaddr_t *src, const bdaddr_t *dst, struct hidp
snprintf(req->name, 128, "%s", str + pos);
+ free(str);
req->rd_size = strlen(desc) / 2;
req->rd_data = malloc(req->rd_size);
if (!req->rd_data) {
--
1.6.3.3
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] Fix GUI crash while connecting Interlink Bluetooth Mouse in android platform.
2010-10-19 9:54 [PATCH] Fix GUI crash while connecting Interlink Bluetooth Mouse in android platform Balamurugan Mahalingam
@ 2010-10-19 11:23 ` Johan Hedberg
2010-10-19 12:01 ` Balamurugan Mahalingam
0 siblings, 1 reply; 3+ messages in thread
From: Johan Hedberg @ 2010-10-19 11:23 UTC (permalink / raw)
To: Balamurugan Mahalingam; +Cc: marcel, linux-bluetooth, charubala
Hi,
On Tue, Oct 19, 2010, Balamurugan Mahalingam wrote:
> Crash is due to some junk characters in the device name.
> The device name is copied from a string variable after freeing the memory it points to, so there were some junk characters in it which was the reason for the crash.
> Fixing the issue by freeing the memory in string variable after device name is copied.
>
> Signed-off-by: Balamurugan Mahalingam <mbalamurugan@atheros.com>
> ---
> compat/sdp.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
Looks like a good fix, but could you please fix your commit message and
resend:
1. The commit message doesn't so much describe the change as it does
some symptom in a downstream system (android). E.g. the summary line
should be something like "Fix accessing freed memory". You can still
talk about the background to this issue wrt. android but the main point
should be in a bluez-only context.
2. Keep the commit message lines below 74 characters so that it's
properly viewable on a 80-character wide terminal when running "git log"
3. Remove the signed-off-by line. We don't use that in userspace.
Johan
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Fix GUI crash while connecting Interlink Bluetooth Mouse in android platform.
2010-10-19 11:23 ` Johan Hedberg
@ 2010-10-19 12:01 ` Balamurugan Mahalingam
0 siblings, 0 replies; 3+ messages in thread
From: Balamurugan Mahalingam @ 2010-10-19 12:01 UTC (permalink / raw)
To: Balamurugan Mahalingam, marcel, linux-bluetooth, charubala
Johan Hedberg wrote:
> Hi,
>
> On Tue, Oct 19, 2010, Balamurugan Mahalingam wrote:
>
>> Crash is due to some junk characters in the device name.
>> The device name is copied from a string variable after freeing the memory it points to, so there were some junk characters in it which was the reason for the crash.
>> Fixing the issue by freeing the memory in string variable after device name is copied.
>>
>> Signed-off-by: Balamurugan Mahalingam <mbalamurugan@atheros.com>
>> ---
>> compat/sdp.c | 2 +-
>> 1 files changed, 1 insertions(+), 1 deletions(-)
>>
>
> Looks like a good fix, but could you please fix your commit message and
> resend:
>
> 1. The commit message doesn't so much describe the change as it does
> some symptom in a downstream system (android). E.g. the summary line
> should be something like "Fix accessing freed memory". You can still
> talk about the background to this issue wrt. android but the main point
> should be in a bluez-only context.
>
> 2. Keep the commit message lines below 74 characters so that it's
> properly viewable on a 80-character wide terminal when running "git log"
>
> 3. Remove the signed-off-by line. We don't use that in userspace.
>
> Johan
> .
>
>
Hi Johan,
Thanks for your comments. I will do the changes and send the patch once
again
Thanks
Balamurugan Mahalingam
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2010-10-19 12:01 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-19 9:54 [PATCH] Fix GUI crash while connecting Interlink Bluetooth Mouse in android platform Balamurugan Mahalingam
2010-10-19 11:23 ` Johan Hedberg
2010-10-19 12:01 ` Balamurugan Mahalingam
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).