All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] voicecall: don't dereference a supplied null value
@ 2015-11-20  8:36 Simon Fels
  2015-11-29 22:01 ` Denis Kenzior
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Fels @ 2015-11-20  8:36 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 1517 bytes --]

When the voicecall atom is unregistered we remove all HFP support as
well but were supplying a zero as value to the emulator status
callbacks which caused the process to crash as we were dereferencing
the supplied value always and not respecting a zero as indicator to
reset.
---
 src/voicecall.c | 15 ++++++++++++---
 1 file changed, 12 insertions(+), 3 deletions(-)

diff --git a/src/voicecall.c b/src/voicecall.c
index a4eef0e..31d845e 100644
--- a/src/voicecall.c
+++ b/src/voicecall.c
@@ -2660,16 +2660,25 @@ static void emulator_hfp_unregister(struct ofono_atom *atom)
 	struct ofono_voicecall *vc = __ofono_atom_get_data(atom);
 	struct ofono_modem *modem = __ofono_atom_get_modem(atom);
 
+	struct emulator_status data;
+	data.vc = vc;
+
+	data.status = OFONO_EMULATOR_CALL_INACTIVE;
 	__ofono_modem_foreach_registered_atom(modem,
 						OFONO_ATOM_TYPE_EMULATOR_HFP,
-						emulator_call_status_cb, 0);
+						emulator_call_status_cb, &data);
+
+	data.status = OFONO_EMULATOR_CALLSETUP_INACTIVE;
 	__ofono_modem_foreach_registered_atom(modem,
 						OFONO_ATOM_TYPE_EMULATOR_HFP,
 						emulator_callsetup_status_cb,
-						0);
+						&data);
+
+	data.status = OFONO_EMULATOR_CALLHELD_NONE;
 	__ofono_modem_foreach_registered_atom(modem,
 						OFONO_ATOM_TYPE_EMULATOR_HFP,
-						emulator_callheld_status_cb, 0);
+						emulator_callheld_status_cb,
+						&data);
 
 	__ofono_modem_foreach_registered_atom(modem,
 						OFONO_ATOM_TYPE_EMULATOR_HFP,
-- 
2.5.0


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

* Re: [PATCH] voicecall: don't dereference a supplied null value
  2015-11-20  8:36 [PATCH] voicecall: don't dereference a supplied null value Simon Fels
@ 2015-11-29 22:01 ` Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2015-11-29 22:01 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 494 bytes --]

Hi Simon,

On 11/20/2015 02:36 AM, Simon Fels wrote:
> When the voicecall atom is unregistered we remove all HFP support as
> well but were supplying a zero as value to the emulator status
> callbacks which caused the process to crash as we were dereferencing
> the supplied value always and not respecting a zero as indicator to
> reset.
> ---
>   src/voicecall.c | 15 ++++++++++++---
>   1 file changed, 12 insertions(+), 3 deletions(-)
>

Applied, thanks

Regards,
-Denis


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

end of thread, other threads:[~2015-11-29 22:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-20  8:36 [PATCH] voicecall: don't dereference a supplied null value Simon Fels
2015-11-29 22:01 ` 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.