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

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