* [Bluez-devel] [PATCH] hcid/dbus crasher fix
@ 2005-08-18 16:50 Nathaniel McCallum
2005-08-19 14:53 ` Marcel Holtmann
0 siblings, 1 reply; 2+ messages in thread
From: Nathaniel McCallum @ 2005-08-18 16:50 UTC (permalink / raw)
To: bluez-devel
[-- Attachment #1: Type: text/plain, Size: 281 bytes --]
The following patch corrects a crasher bug when using hcid with dbus.
I'm still having a problem even after this bug, hcid just exits with
exitstatus 1 (but at least it doesn't crash). Any ideas?
BTW, I'm not subscribed to the list, so please CC me in any responses.
Nathaniel
[-- Attachment #2: bluez-utils-2.19-segfault.patch --]
[-- Type: text/x-patch, Size: 1029 bytes --]
diff -Nru bluez-utils-2.19.orig/hcid/dbus.c bluez-utils-2.19/hcid/dbus.c
--- bluez-utils-2.19.orig/hcid/dbus.c 2005-08-06 07:14:00.000000000 -0400
+++ bluez-utils-2.19/hcid/dbus.c 2005-08-18 12:36:03.000000000 -0400
@@ -224,9 +224,13 @@
DBusMessageIter iter;
#endif
char local_addr[18], peer_addr[18];
+ char **local_addr_tmp, **peer_addr_tmp, **name_tmp;
ba2str(local, local_addr);
ba2str(peer, peer_addr);
+ local_addr_tmp = &local_addr;
+ peer_addr_tmp = &peer_addr;
+ name_tmp = &name;
message = dbus_message_new_signal("/org/bluez/DevAgent",
"org.bluez.DevAgent", "RemoteName");
@@ -237,9 +241,9 @@
#ifdef HAVE_DBUS_MESSAGE_APPEND_ARGS
dbus_message_append_args(message,
- DBUS_TYPE_STRING, local_addr,
- DBUS_TYPE_STRING, peer_addr,
- DBUS_TYPE_STRING, name,
+ DBUS_TYPE_STRING, &local_addr_tmp,
+ DBUS_TYPE_STRING, &peer_addr_tmp,
+ DBUS_TYPE_STRING, &name_tmp,
DBUS_TYPE_INVALID);
#else
dbus_message_append_iter_init(message, &iter);
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [Bluez-devel] [PATCH] hcid/dbus crasher fix
2005-08-18 16:50 [Bluez-devel] [PATCH] hcid/dbus crasher fix Nathaniel McCallum
@ 2005-08-19 14:53 ` Marcel Holtmann
0 siblings, 0 replies; 2+ messages in thread
From: Marcel Holtmann @ 2005-08-19 14:53 UTC (permalink / raw)
To: bluez-devel; +Cc: Nathaniel McCallum
Hi Nathaniel,
> The following patch corrects a crasher bug when using hcid with dbus.
>
> I'm still having a problem even after this bug, hcid just exits with
> exitstatus 1 (but at least it doesn't crash). Any ideas?
this patch is not correct, because ba2str() then writes 18 bytes to a
pointer where you haven't allocated memory for. Why do you need this
kind of fix.
> BTW, I'm not subscribed to the list, so please CC me in any responses.
Why don't you subscribe?
Regards
Marcel
-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2005-08-19 14:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-18 16:50 [Bluez-devel] [PATCH] hcid/dbus crasher fix Nathaniel McCallum
2005-08-19 14:53 ` Marcel Holtmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox