From: Szymon Janc <szymon.janc@tieto.com>
To: Jakub Tyszkowski <jakub.tyszkowski@tieto.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] android/handsfree-client: Verify variable length data received from IPC
Date: Fri, 26 Sep 2014 12:28:45 +0200 [thread overview]
Message-ID: <9352746.HT4QSUUR0E@uw000953> (raw)
In-Reply-To: <1411725855-6531-1-git-send-email-jakub.tyszkowski@tieto.com>
Hi Jakub,
On Friday 26 of September 2014 12:04:15 Jakub Tyszkowski wrote:
> Dial uses variable length data, check if we received as much as was
> declared. This fixes two negative ipc-tester cases for hfp-client dial
> api call not passing.
> ---
> android/handsfree-client.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/android/handsfree-client.c b/android/handsfree-client.c
> index be29952..773ef76 100644
> --- a/android/handsfree-client.c
> +++ b/android/handsfree-client.c
> @@ -97,6 +97,15 @@ static void handle_volume_control(const void *buf, uint16_t len)
>
> static void handle_dial(const void *buf, uint16_t len)
> {
> + const struct hal_cmd_hf_client_dial *cmd = buf;
> +
> + if (len != sizeof(*cmd) + cmd->number_len) {
> + error("Malformed number data, size (%u bytes), terminating",
> + len);
> + raise(SIGTERM);
> + return;
> + }
> +
> DBG("Not Implemented");
> ipc_send_rsp(hal_ipc, HAL_SERVICE_ID_HANDSFREE_CLIENT,
> HAL_OP_HF_CLIENT_DIAL, HAL_STATUS_UNSUPPORTED);
>
Applied. Thanks.
--
Best regards,
Szymon Janc
prev parent reply other threads:[~2014-09-26 10:28 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-26 10:04 [PATCH] android/handsfree-client: Verify variable length data received from IPC Jakub Tyszkowski
2014-09-26 10:28 ` Szymon Janc [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9352746.HT4QSUUR0E@uw000953 \
--to=szymon.janc@tieto.com \
--cc=jakub.tyszkowski@tieto.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox