From 0175c68400bebaee727e9b378c181ed6f7a435ff Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 5 Feb 2021 12:46:44 +0530 Subject: [PATCH 1/2] esp_tls: Fix misplaced paranthesis in esp_tls_mbedtls.c Fixes one part of - https://github.com/espressif/esp-idf/issues/6440 --- components/esp-tls/esp_tls_mbedtls.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/esp-tls/esp_tls_mbedtls.c b/components/esp-tls/esp_tls_mbedtls.c index 2be611876d..424bf00044 100644 --- a/components/esp-tls/esp_tls_mbedtls.c +++ b/components/esp-tls/esp_tls_mbedtls.c @@ -449,7 +449,7 @@ esp_err_t set_client_config(const char *hostname, size_t hostlen, esp_tls_cfg_t if (cfg->alpn_protos) { #ifdef CONFIG_MBEDTLS_SSL_ALPN - if ((ret = mbedtls_ssl_conf_alpn_protocols(&tls->conf, cfg->alpn_protos) != 0)) { + if ((ret = mbedtls_ssl_conf_alpn_protocols(&tls->conf, cfg->alpn_protos)) != 0) { ESP_LOGE(TAG, "mbedtls_ssl_conf_alpn_protocols returned -0x%x", -ret); ESP_INT_EVENT_TRACKER_CAPTURE(tls->error_handle, ESP_TLS_ERR_TYPE_MBEDTLS, -ret); return ESP_ERR_MBEDTLS_SSL_CONF_ALPN_PROTOCOLS_FAILED; From d36479728cd50b030756ca08f767d15f64277da7 Mon Sep 17 00:00:00 2001 From: Aditya Patwardhan Date: Fri, 5 Feb 2021 12:47:57 +0530 Subject: [PATCH 2/2] protocomm: Fixed NULL check of allocated memory Fixes one part of - https://github.com/espressif/esp-idf/issues/6440 --- components/protocomm/src/common/protocomm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/protocomm/src/common/protocomm.c b/components/protocomm/src/common/protocomm.c index 683e360903..cdfd8d7965 100644 --- a/components/protocomm/src/common/protocomm.c +++ b/components/protocomm/src/common/protocomm.c @@ -378,7 +378,7 @@ static int protocomm_version_handler(uint32_t session_id, /* Output is a non null terminated string with length specified */ *outlen = strlen(pc->ver); *outbuf = malloc(*outlen); - if (outbuf == NULL) { + if (*outbuf == NULL) { ESP_LOGE(TAG, "Failed to allocate memory for version response"); return ESP_ERR_NO_MEM; }