From 238e717568e0c93849404a734c76565e8707725d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Love=20H=C3=B6rnquist=20=C3=85strand?= Date: Mon, 4 Dec 2006 23:41:18 +0000 Subject: [PATCH] =?UTF-8?q?Clear=20errno=20before=20calling=20the=20strtol?= =?UTF-8?q?=20functions.=20From=20Paul=20Stoeber=20to=20OpenBSD=20by=20Ray?= =?UTF-8?q?=20Lai=20and=20Bj=C3=B6rn=20Sandell.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19215 ec53bebd-3082-4978-b11e-865c3cabbd6b --- appl/login/limits_conf.c | 1 + lib/hdb/hdb-ldap.c | 1 + 2 files changed, 2 insertions(+) diff --git a/appl/login/limits_conf.c b/appl/login/limits_conf.c index afa8539c4..0cd62a824 100644 --- a/appl/login/limits_conf.c +++ b/appl/login/limits_conf.c @@ -157,6 +157,7 @@ read_limits_conf(const char *file, const struct passwd *pwd) if(strcmp(args[3], "-") == 0) { value = RLIM_INFINITY; } else { + errno = 0; value = strtol(args[3], &end, 10); if(*end != '\0') { syslog(LOG_ERR, "%s: line %d: bad value %s", file, lineno, args[3]); diff --git a/lib/hdb/hdb-ldap.c b/lib/hdb/hdb-ldap.c index cc45be0ac..aa0cad000 100644 --- a/lib/hdb/hdb-ldap.c +++ b/lib/hdb/hdb-ldap.c @@ -1171,6 +1171,7 @@ LDAP_message2entry(krb5_context context, HDB * db, LDAPMessage * msg, values = ldap_get_values(HDB2LDAP(db), msg, "krb5KDCFlags"); if (values != NULL) { + errno = 0; tmp = strtoul(values[0], (char **) NULL, 10); if (tmp == ULONG_MAX && errno == ERANGE) { krb5_set_error_string(context, "strtoul: could not convert flag");