aboutsummaryrefslogtreecommitdiff
path: root/openssl/agent/pkcs11
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-07-07 08:55:26 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-07-07 08:55:26 +0200
commit9f412e995b898b6d75f343212f6a4b3ba399d9f5 (patch)
treec9948bc0aa5c8de9c32a353b426ac6c4edf3af18 /openssl/agent/pkcs11
parent20e15fb0a6ecb043a7c5b9ae94eddf0e6cb3d53a (diff)
Clear errno before calling strto*() functions
Diffstat (limited to 'openssl/agent/pkcs11')
-rw-r--r--openssl/agent/pkcs11/url.cxx1
1 files changed, 1 insertions, 0 deletions
diff --git a/openssl/agent/pkcs11/url.cxx b/openssl/agent/pkcs11/url.cxx
index 5bed7b0..0c946d9 100644
--- a/openssl/agent/pkcs11/url.cxx
+++ b/openssl/agent/pkcs11/url.cxx
@@ -27,6 +27,7 @@ namespace openssl
{
const char* b (s.c_str ());
char* e (nullptr);
+ errno = 0; // We must clear it according to POSIX.
uint64_t v (strtoull (b, &e, 10)); // Can't throw.
if (errno != ERANGE && e == b + s.size () && v >= min && v <= max)