From d54abf8c6300e0aa72eea9bd03231e0af8b85c58 Mon Sep 17 00:00:00 2001 From: Jonathan Hui Date: Mon, 27 Aug 2018 09:41:32 -0700 Subject: [PATCH] [travis] fix scan-build (#2990) --- src/core/thread/lowpan.cpp | 1 - third_party/mbedtls/mbedtls-config.h | 16 ++++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/core/thread/lowpan.cpp b/src/core/thread/lowpan.cpp index 7e9ac33e4..531b320ae 100644 --- a/src/core/thread/lowpan.cpp +++ b/src/core/thread/lowpan.cpp @@ -1240,7 +1240,6 @@ otError FragmentHeader::Init(const Message &aMessage, uint16_t aOffset) { bytesRead = aMessage.Read(aOffset, sizeof(mOffset), &mOffset); VerifyOrExit(bytesRead == sizeof(mOffset), error = OT_ERROR_PARSE); - aOffset += bytesRead; } exit: diff --git a/third_party/mbedtls/mbedtls-config.h b/third_party/mbedtls/mbedtls-config.h index a65b15331..8b365a211 100644 --- a/third_party/mbedtls/mbedtls-config.h +++ b/third_party/mbedtls/mbedtls-config.h @@ -1782,7 +1782,9 @@ __inline int windows_kernel_snprintf(char * s, size_t n, const char * format, .. * * Requires: MBEDTLS_ECP_C */ -//#define MBEDTLS_ECDH_C +#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) +#define MBEDTLS_ECDH_C +#endif /** * \def MBEDTLS_ECDSA_C @@ -1797,7 +1799,9 @@ __inline int windows_kernel_snprintf(char * s, size_t n, const char * format, .. * * Requires: MBEDTLS_ECP_C, MBEDTLS_ASN1_WRITE_C, MBEDTLS_ASN1_PARSE_C */ -//#define MBEDTLS_ECDSA_C +#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) +#define MBEDTLS_ECDSA_C +#endif /** * \def MBEDTLS_ECJPAKE_C @@ -2403,7 +2407,9 @@ __inline int windows_kernel_snprintf(char * s, size_t n, const char * format, .. * * This module is required for the X.509 parsing modules. */ -//#define MBEDTLS_X509_USE_C +#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) +#define MBEDTLS_X509_USE_C +#endif /** * \def MBEDTLS_X509_CRT_PARSE_C @@ -2419,7 +2425,9 @@ __inline int windows_kernel_snprintf(char * s, size_t n, const char * format, .. * * This module is required for X.509 certificate parsing. */ -//#define MBEDTLS_X509_CRT_PARSE_C +#if defined(MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED) +#define MBEDTLS_X509_CRT_PARSE_C +#endif /** * \def MBEDTLS_X509_CRL_PARSE_C