Clear errno before calling the strtol functions. From Paul Stoeber to

OpenBSD by Ray Lai and Björn Sandell.


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@19215 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Love Hörnquist Åstrand
2006-12-04 23:41:18 +00:00
parent 623e559f60
commit 238e717568
2 changed files with 2 additions and 0 deletions

View File

@@ -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]);

View File

@@ -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");