Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit de5c0ca6 authored by Sebastien Griffoul's avatar Sebastien Griffoul Committed by Pavlin Radoslavov
Browse files

Fix NULL pointer crash in send_at_cmd



If the string argument of send_at_cmd is a null pointer,
then the function should not crash: indeed this is a valid
parameters which can be used to send an AT cmd which doesn't
require any extra parameter.

Test: trivial fix. Existing unit tests still pass.
Change-Id: I3d83eebed660d703cd5a93a19dc73f4f354ab7bf
Signed-off-by: default avatarSebastien Griffoul <sebastien.griffoul@intel.com>
parent 0eefffee
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -660,7 +660,7 @@ static bt_status_t send_at_cmd(int cmd,int val1,int val2,const char *arg)
{
    CHECK_BTHF_CLIENT_SLC_CONNECTED();
    BTIF_TRACE_EVENT("%s Cmd %d val1 %d val2 %d arg %s",
            __func__,cmd,val1,val2,arg);
                     __func__, cmd, val1, val2, (arg != NULL) ? arg : "<null>");
    BTA_HfClientSendAT(btif_hf_client_cb.handle, cmd, val1, val2, arg);

    return BT_STATUS_SUCCESS;