mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
bt: Fixed esp_spp_write() crash when len is 0
Closes https://github.com/espressif/esp-idf/issues/9977
This commit is contained in:
parent
8cb934ab2e
commit
4e895104ef
@ -188,6 +188,11 @@ esp_err_t esp_spp_write(uint32_t handle, int len, uint8_t *p_data)
|
|||||||
btc_spp_args_t arg;
|
btc_spp_args_t arg;
|
||||||
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
ESP_BLUEDROID_STATUS_CHECK(ESP_BLUEDROID_STATUS_ENABLED);
|
||||||
|
|
||||||
|
if (len <= 0 || p_data == NULL) {
|
||||||
|
LOG_ERROR("Invalid data or len!\n");
|
||||||
|
return ESP_ERR_INVALID_ARG;
|
||||||
|
}
|
||||||
|
|
||||||
msg.sig = BTC_SIG_API_CALL;
|
msg.sig = BTC_SIG_API_CALL;
|
||||||
msg.pid = BTC_PID_SPP;
|
msg.pid = BTC_PID_SPP;
|
||||||
msg.act = BTC_SPP_ACT_WRITE;
|
msg.act = BTC_SPP_ACT_WRITE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user