diff --git a/components/protocomm/src/common/protocomm.c b/components/protocomm/src/common/protocomm.c index 1a548267904..824d59f0a7f 100644 --- a/components/protocomm/src/common/protocomm.c +++ b/components/protocomm/src/common/protocomm.c @@ -1,5 +1,5 @@ /* - * SPDX-FileCopyrightText: 2018-2025 Espressif Systems (Shanghai) CO LTD + * SPDX-FileCopyrightText: 2018-2026 Espressif Systems (Shanghai) CO LTD * * SPDX-License-Identifier: Apache-2.0 */ @@ -433,6 +433,10 @@ esp_err_t protocomm_get_sec_version(protocomm_t *pc, int *sec_ver, uint8_t *sec_ return ESP_ERR_INVALID_ARG; } + if (pc->sec == NULL) { + return ESP_ERR_INVALID_STATE; + } + *sec_ver = pc->sec->ver; *sec_patch_ver = pc->sec->patch_ver;