hi Jonas,

On Fri, 26 Oct 2018, 12:13 Jonas Bonn, <[email protected]> wrote:

> From: Jonas Bonn <[email protected]>
>
> Move initialization of 'dcs' ahead of 'content' fetch to prevent
> uninitialized use.
> ---
>  drivers/huaweimodem/ussd.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/huaweimodem/ussd.c b/drivers/huaweimodem/ussd.c
> index fbed3cd0..f4001108 100644
> --- a/drivers/huaweimodem/ussd.c
> +++ b/drivers/huaweimodem/ussd.c
> @@ -62,12 +62,12 @@ static void cusd_parse(GAtResult *result, struct
> ofono_ussd *ussd)
>         if (!g_at_result_iter_next_number(&iter, &status))
>                 return;
>
> -       if (!g_at_result_iter_next_string(&iter, &content))
> -               goto out;
> -
>         if (!g_at_result_iter_next_number(&iter, &dcs))
>                 dcs = 0;
>
> +       if (!g_at_result_iter_next_string(&iter, &content))
> +               goto out;
> +
>

aren't you changing the order of the parameters in the command response?
Have you tested this on an actual modem?

        msg_ptr = decode_hex_own_buf(content, -1, &msg_len, 0, msg);
>
> regards,
Giacinto
_______________________________________________
ofono mailing list
[email protected]
https://lists.ofono.org/mailman/listinfo/ofono

Reply via email to