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

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