summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lasso/saml-2.0/provider.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lasso/saml-2.0/provider.c b/lasso/saml-2.0/provider.c
index 4f9192d5..35beeaa9 100644
--- a/lasso/saml-2.0/provider.c
+++ b/lasso/saml-2.0/provider.c
@@ -127,8 +127,10 @@ xsdIsFalse(xmlChar *value)
static gboolean
xsdUnsignedShortParse(xmlChar *value, int *out) {
- int l = strtol((char*)value, NULL, 10);
+ int l = 0;
+ errno = 0;
+ l = strtol((char*)value, NULL, 10);
if (((l == LONG_MIN || l == LONG_MAX) && errno == ERANGE) ||
errno == EINVAL || l < 0 || l >= 65535) {
return FALSE;