Merge branch 'bugfix/pppos_client_dce_deref' into 'master'

Examples/pppos_client: Fix potential nullptr deref on DCE init (GitHub PR)

Closes IDFGH-5730

See merge request espressif/esp-idf!15392
pull/7680/head
David Čermák 2021-10-05 12:52:47 +00:00
commit 6237f5859d
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -242,7 +242,7 @@ static esp_err_t esp_modem_dte_send_cmd(modem_dte_t *dte, const char *command, u
esp_err_t ret = ESP_FAIL;
modem_dce_t *dce = dte->dce;
ESP_LOGD(MODEM_TAG, "Sending command:%s", command);
MODEM_CHECK(dce, "DTE has not yet bind with DCE", err);
MODEM_CHECK(dce, "DTE has not yet bind with DCE", errdce);
MODEM_CHECK(command, "command is NULL", err);
esp_modem_dte_t *esp_dte = __containerof(dte, esp_modem_dte_t, parent);
esp_dte->consumed = 0;
@ -256,6 +256,7 @@ static esp_err_t esp_modem_dte_send_cmd(modem_dte_t *dte, const char *command, u
ret = ESP_OK;
err:
dce->handle_line = NULL;
errdce:
return ret;
}