fix(esp_wifi): Fix coverity issue CID: 470126

This commit is contained in:
Kapil Gupta
2024-12-21 00:18:43 +05:30
committed by BOT
parent 63e6ed35cb
commit b72d39ab3e

View File

@@ -983,7 +983,12 @@ int crypto_pk_write_formatted_pubkey_der(mbedtls_pk_context *key, unsigned char
c = buf + size;
MBEDTLS_ASN1_CHK_ADD(len, mbedtls_pk_write_pubkey_formatted(&c, buf, key, format));
ret = mbedtls_pk_write_pubkey_formatted(&c, buf, key, format);
if (ret < 0) {
return ret;
}
MBEDTLS_ASN1_CHK_ADD(len, ret);
if (c - buf < 1) {
return (MBEDTLS_ERR_ASN1_BUF_TOO_SMALL);