summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorJosef Moellers <jmoellers@suse.de>2017-02-09 12:27:59 +0100
committerTomas Mraz <tmraz@fedoraproject.org>2017-02-09 12:27:59 +0100
commita9253114c719eace32006058656671f8987eeb12 (patch)
tree838ae0e983e72af7b96f0d6c3c4823bfd1850f19 /modules
parentc8dc2b4c2045bb44a038356751e0f0428afe1171 (diff)
Properly test for strtol() failure to find any digits.
* modules/pam_access/pam_access.c (network_netmask_match): Test for endptr set to beginning and not NULL.
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_access/pam_access.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/pam_access/pam_access.c b/modules/pam_access/pam_access.c
index d6895788..ba3b99f9 100644
--- a/modules/pam_access/pam_access.c
+++ b/modules/pam_access/pam_access.c
@@ -727,7 +727,7 @@ network_netmask_match (pam_handle_t *pamh,
{ /* netmask as integre value */
char *endptr = NULL;
netmask = strtol(netmask_ptr, &endptr, 0);
- if ((endptr == NULL) || (*endptr != '\0'))
+ if ((endptr == netmask_ptr) || (*endptr != '\0'))
{ /* invalid netmask value */
return NO;
}