Blame SOURCES/Fix-strtol-error-checking.patch

f9ac4e
From 26a82531170a046c3f8d04e85276e8bd118a36ce Mon Sep 17 00:00:00 2001
f9ac4e
From: Simo Sorce <simo@redhat.com>
f9ac4e
Date: Tue, 3 Oct 2017 12:33:38 -0400
f9ac4e
Subject: [PATCH] Fix strtol error checking
f9ac4e
f9ac4e
Signed-off-by: Simo Sorce <simo@redhat.com>
f9ac4e
Reviewed-by: Robbie Harwood <rharwood@redhat.com>
f9ac4e
(cherry picked from commit 7cddf31b6ea7d0c67ac8a086d6b61d3f3631f47c)
f9ac4e
---
f9ac4e
 src/mod_auth_gssapi.c | 4 ++--
f9ac4e
 1 file changed, 2 insertions(+), 2 deletions(-)
f9ac4e
f9ac4e
diff --git a/src/mod_auth_gssapi.c b/src/mod_auth_gssapi.c
f9ac4e
index 59120d1..74962d1 100644
f9ac4e
--- a/src/mod_auth_gssapi.c
f9ac4e
+++ b/src/mod_auth_gssapi.c
f9ac4e
@@ -1502,7 +1502,7 @@ static const char *mag_deleg_ccache_perms(cmd_parms *parms, void *mconfig,
f9ac4e
         if (isdigit(*p)) {
f9ac4e
             char *endptr;
f9ac4e
             cfg->deleg_ccache_uid = strtol(p, &endptr, 0);
f9ac4e
-            if (errno != 0 || endptr != '\0') {
f9ac4e
+            if (errno != 0 || (endptr && *endptr != '\0')) {
f9ac4e
                 ap_log_error(APLOG_MARK, APLOG_ERR, 0, parms->server,
f9ac4e
                              "Invalid GssapiDelegCcachePerms uid value [%s]",
f9ac4e
                              p);
f9ac4e
@@ -1527,7 +1527,7 @@ static const char *mag_deleg_ccache_perms(cmd_parms *parms, void *mconfig,
f9ac4e
         if (isdigit(*p)) {
f9ac4e
             char *endptr;
f9ac4e
             cfg->deleg_ccache_gid = strtol(p, &endptr, 0);
f9ac4e
-            if (errno != 0 || endptr != '\0') {
f9ac4e
+            if (errno != 0 || (endptr && *endptr != '\0')) {
f9ac4e
                 ap_log_error(APLOG_MARK, APLOG_ERR, 0, parms->server,
f9ac4e
                              "Invalid GssapiDelegCcachePerms gid value [%s]",
f9ac4e
                              p);