Commit 281f54f5 authored by Vadim Zeitlin's avatar Vadim Zeitlin

Check for negative date components in parse10()

Using them in mktime() later would fail anyhow, but here we can give a
slightly better error message.
parent f2e84c4b
......@@ -21,6 +21,9 @@ long parse10(char const * & p1, char * & p2)
long v = std::strtol(p1, &p2, 10);
if (p2 != p1)
{
if (v < 0)
throw soci::soci_error("Negative date/time field component.");
p1 = p2 + 1;
return v;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment