From a9253114c719eace32006058656671f8987eeb12 Mon Sep 17 00:00:00 2001 From: Josef Moellers Date: Thu, 9 Feb 2017 12:27:59 +0100 Subject: 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. --- modules/pam_access/pam_access.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/pam_access') 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; } -- cgit v1.2.3