Add max and min values and restrict bounds
This commit is contained in:
@@ -264,7 +264,7 @@ static parserStatus_e processTxInternal(txContext_t *context) {
|
|||||||
return USTREAM_PROCESSING;
|
return USTREAM_PROCESSING;
|
||||||
}
|
}
|
||||||
// EIP 2718: TransactionType might be present before the TransactionPayload.
|
// EIP 2718: TransactionType might be present before the TransactionPayload.
|
||||||
if (*context->workBuffer > 0x00 && *context->workBuffer < 0x7f) {
|
if (*context->workBuffer >= MIN_TX_TYPE && *context->workBuffer <= MAX_TX_TYPE) {
|
||||||
uint8_t maybeType = *context->workBuffer;
|
uint8_t maybeType = *context->workBuffer;
|
||||||
PRINTF("TX TYPE: %u\n", maybeType);
|
PRINTF("TX TYPE: %u\n", maybeType);
|
||||||
|
|
||||||
|
|||||||
@@ -53,6 +53,9 @@ typedef enum rlpTxField_e {
|
|||||||
TX_RLP_DONE
|
TX_RLP_DONE
|
||||||
} rlpTxField_e;
|
} rlpTxField_e;
|
||||||
|
|
||||||
|
#define MIN_TX_TYPE 0x00
|
||||||
|
#define MAX_TX_TYPE 0x7f
|
||||||
|
|
||||||
// EIP 2718 TransactionType
|
// EIP 2718 TransactionType
|
||||||
typedef enum txType_e {
|
typedef enum txType_e {
|
||||||
LEGACY_TX,
|
LEGACY_TX,
|
||||||
|
|||||||
Reference in New Issue
Block a user