summaryrefslogtreecommitdiff
path: root/src/times.cc
diff options
context:
space:
mode:
authorSarah Jamie Lewis <sarah@openprivacy.ca>2020-02-10 11:41:04 -0800
committerMartin Michlmayr <tbm@cyrius.com>2020-04-27 16:11:48 +0800
commit466ed19374903299a3ad21213d3a91e18559f9db (patch)
tree9b909748eb8482b631fa64ac6c41b4ae26268f35 /src/times.cc
parentd31e41659fefc04cf82f0d1cea5dd7f68f4f9664 (diff)
downloadfork-ledger-466ed19374903299a3ad21213d3a91e18559f9db.tar.gz
fork-ledger-466ed19374903299a3ad21213d3a91e18559f9db.tar.bz2
fork-ledger-466ed19374903299a3ad21213d3a91e18559f9db.zip
Fix buffer overflow when evaluating pricing date
Diffstat (limited to 'src/times.cc')
-rw-r--r--src/times.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/times.cc b/src/times.cc
index ffd62428..acdf7eb0 100644
--- a/src/times.cc
+++ b/src/times.cc
@@ -237,6 +237,10 @@ string_to_month_of_year(const std::string& str)
datetime_t parse_datetime(const char * str)
{
+ if (std::strlen(str) > 127) {
+ throw_(date_error, _f("Invalid date: %1%") % str);
+ }
+
char buf[128];
std::strcpy(buf, str);