* [PATCH] smart-messaging: set agent to NULL after free
@ 2011-02-02 18:53 Lucas De Marchi
2011-02-02 19:24 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Lucas De Marchi @ 2011-02-02 18:53 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 865 bytes --]
If agent is not set to NULL after it's freed, the following situation
would not work:
smart_messaging_register_agent()
smart_messaging_unregister_agent()
smart_messaging_register_agent()
And this one could potentially crash oFono:
smart_messaging_register_agent()
smart_messaging_unregister_agent()
smart_messaging_unregister_agent()
---
plugins/smart-messaging.c | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/plugins/smart-messaging.c b/plugins/smart-messaging.c
index 40af89f..52344de 100644
--- a/plugins/smart-messaging.c
+++ b/plugins/smart-messaging.c
@@ -165,6 +165,7 @@ static DBusMessage *smart_messaging_unregister_agent(DBusConnection *conn,
return __ofono_error_failed(msg);
sms_agent_free(sm->agent);
+ sm->agent = NULL;
return dbus_message_new_method_return(msg);
}
--
1.7.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] smart-messaging: set agent to NULL after free
2011-02-02 18:53 [PATCH] smart-messaging: set agent to NULL after free Lucas De Marchi
@ 2011-02-02 19:24 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2011-02-02 19:24 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 592 bytes --]
Hi Lucas,
On 02/02/2011 12:53 PM, Lucas De Marchi wrote:
> If agent is not set to NULL after it's freed, the following situation
> would not work:
>
> smart_messaging_register_agent()
> smart_messaging_unregister_agent()
> smart_messaging_register_agent()
>
> And this one could potentially crash oFono:
>
> smart_messaging_register_agent()
> smart_messaging_unregister_agent()
> smart_messaging_unregister_agent()
> ---
> plugins/smart-messaging.c | 1 +
> 1 files changed, 1 insertions(+), 0 deletions(-)
>
Patch has been applied, thanks.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-02 19:24 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-02 18:53 [PATCH] smart-messaging: set agent to NULL after free Lucas De Marchi
2011-02-02 19:24 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.