Skip to content

Commit

Permalink
fix: add case where chainID is null (to pass ci[Clang Static Analyzer]
Browse files Browse the repository at this point in the history
  • Loading branch information
keiff3r committed Mar 20, 2024
1 parent 1eb83d2 commit ed2062f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src_common/ethUstream.c
Original file line number Diff line number Diff line change
Expand Up @@ -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]) {
Expand Down

0 comments on commit ed2062f

Please sign in to comment.