From ed2062fab86bde196272ed378fc3c3611b5f4736 Mon Sep 17 00:00:00 2001 From: keiff3r Date: Wed, 20 Mar 2024 18:47:00 +0100 Subject: [PATCH] fix: add case where chainID is null (to pass ci[Clang Static Analyzer] --- src_common/ethUstream.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src_common/ethUstream.c b/src_common/ethUstream.c index db9505e..e2b9af6 100644 --- a/src_common/ethUstream.c +++ b/src_common/ethUstream.c @@ -382,6 +382,9 @@ static void processAndDiscard(txContext_t *context) { static const uint16_t AUTHORIZED_CHAIN_IDS[NUM_CHAIN_IDS] = {42220, 44787, 17323}; static int isChainIDAuthorized(uint8_t chainID[4]) { + if(chainID == NULL) { + return 0; + } uint16_t chainIDInt = (chainID[0] << 8) | chainID[1]; for (int i = 0; i < NUM_CHAIN_IDS; i++) { if (chainIDInt == AUTHORIZED_CHAIN_IDS[i]) {