Skip to content

Commit 7cddf31

Browse files
committed
Fix strtol error checking
Signed-off-by: Simo Sorce <simo@redhat.com> Reviewed-by: Robbie Harwood <rharwood@redhat.com>
1 parent 0d89b21 commit 7cddf31

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/mod_auth_gssapi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ static const char *mag_deleg_ccache_perms(cmd_parms *parms, void *mconfig,
15421542
if (isdigit(*p)) {
15431543
char *endptr;
15441544
cfg->deleg_ccache_uid = strtol(p, &endptr, 0);
1545-
if (errno != 0 || endptr != '\0') {
1545+
if (errno != 0 || (endptr && *endptr != '\0')) {
15461546
ap_log_error(APLOG_MARK, APLOG_ERR, 0, parms->server,
15471547
"Invalid GssapiDelegCcachePerms uid value [%s]",
15481548
p);
@@ -1567,7 +1567,7 @@ static const char *mag_deleg_ccache_perms(cmd_parms *parms, void *mconfig,
15671567
if (isdigit(*p)) {
15681568
char *endptr;
15691569
cfg->deleg_ccache_gid = strtol(p, &endptr, 0);
1570-
if (errno != 0 || endptr != '\0') {
1570+
if (errno != 0 || (endptr && *endptr != '\0')) {
15711571
ap_log_error(APLOG_MARK, APLOG_ERR, 0, parms->server,
15721572
"Invalid GssapiDelegCcachePerms gid value [%s]",
15731573
p);

0 commit comments

Comments
 (0)