Skip to content

Commit

Permalink
Add date check
Browse files Browse the repository at this point in the history
  • Loading branch information
levoncrypto committed Aug 19, 2024
1 parent f9df2a0 commit 08ed4d1
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/wallet/wallet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2368,6 +2368,9 @@ static std::time_t parseDate(const std::string& dateStr) {
std::tm tm = {};
std::istringstream ss(dateStr);
ss >> std::get_time(&tm, "%d-%m-%Y");
if (ss.fail()) {
throw std::invalid_argument("Invalid date format: " + dateStr);
}
return std::mktime(&tm);
}

Expand Down

0 comments on commit 08ed4d1

Please sign in to comment.