Skip to content

Commit

Permalink
Add input validation to timestampFromDateTime (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
mdehoog authored Jan 11, 2025
1 parent 364073b commit 0b52df2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Asn1Decode.sol
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,12 @@ library Asn1Decode {
uint256 second
) private pure returns (uint256) {
require(year >= 1970);
require(1 <= month && month <= 12);
require(1 <= day && day <= 31);
require(hour <= 23);
require(minute <= 59);
require(second <= 59);

int256 _year = int256(year);
int256 _month = int256(month);
int256 _day = int256(day);
Expand Down

0 comments on commit 0b52df2

Please sign in to comment.