Skip to content

Commit

Permalink
api: make sure len doesn't overrun the input buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
julek-wolfssl committed Jan 30, 2025
1 parent 2865b0c commit e4b7a53
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/api.c
Original file line number Diff line number Diff line change
Expand Up @@ -99175,6 +99175,8 @@ static int test_dtls_frag_ch_count_records(byte* b, int len)
records++;
dtlsRH = (DtlsRecordLayerHeader*)b;
recordLen = (dtlsRH->length[0] << 8) | dtlsRH->length[1];
if (recordLen > (size_t)len)
break;
b += sizeof(DtlsRecordLayerHeader) + recordLen;
len -= sizeof(DtlsRecordLayerHeader) + recordLen;
}
Expand Down

0 comments on commit e4b7a53

Please sign in to comment.