Fix multiple vulnerabilities

This commit is contained in:
Jorge Martins
2022-07-08 11:12:50 +02:00
parent 4eb7109b86
commit e0218520d8
20 changed files with 166 additions and 168 deletions

View File

@@ -296,6 +296,12 @@ static void processV(txContext_t *context) {
PRINTF("Invalid type for RLP_V\n");
THROW(EXCEPTION);
}
if (context->currentFieldLength > sizeof(context->content->v)) {
PRINTF("Invalid length for RLP_V\n");
THROW(EXCEPTION);
}
if (context->currentFieldPos < context->currentFieldLength) {
uint32_t copySize =
MIN(context->commandLength, context->currentFieldLength - context->currentFieldPos);