]> granicus.if.org Git - linux-pam/commitdiff
Properly test for strtol() failure to find any digits.
authorJosef Moellers <jmoellers@suse.de>
Thu, 9 Feb 2017 11:27:59 +0000 (12:27 +0100)
committerTomas Mraz <tmraz@fedoraproject.org>
Thu, 9 Feb 2017 11:27:59 +0000 (12:27 +0100)
* modules/pam_access/pam_access.c (network_netmask_match): Test for endptr set
to beginning and not NULL.

modules/pam_access/pam_access.c

index d689578819f3898eb6337417de539897ca5d781f..ba3b99f91384fc7ea34cd6d9b193cd33e9c4460a 100644 (file)
@@ -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;
                }