linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [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

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