mirror of
https://github.com/allankoechke/soci.git
synced 2026-11-30 10:58:24 +00:00
Improve parsing of "timeout" parameter in SQLite backend
Use SOCI cstring_to_integer() instead of std::istringstream and throw an exception if an invalid value is specified for this parameter.
This commit is contained in:
@@ -131,8 +131,8 @@ sqlite3_session_backend::sqlite3_session_backend(
|
||||
}
|
||||
if (params.get_option("timeout", val))
|
||||
{
|
||||
std::istringstream converter(val);
|
||||
converter >> timeout;
|
||||
if (!cstring_to_integer(timeout, val.c_str()) || timeout < 0)
|
||||
throw soci_error("Invalid value for timeout option: {}", val);
|
||||
}
|
||||
if (params.get_option("synchronous", val))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user