From 37099a6e7ddbd394e31186c220f7e6bd2be9a787 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 15 Sep 2016 05:54:53 -0600 Subject: [PATCH] Fix underflow in get_ipa_hostname() when trimming trailing whitespace. --- plugins/sudoers/sssd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/sudoers/sssd.c b/plugins/sudoers/sssd.c index d616b8514..ffb8e0f2d 100644 --- a/plugins/sudoers/sssd.c +++ b/plugins/sudoers/sssd.c @@ -315,7 +315,7 @@ get_ipa_hostname(char **shostp, char **lhostp) char *cp = line; /* Trim trailing and leading spaces. */ - while (isspace((unsigned char)line[len - 1])) + while (len > 0 && isspace((unsigned char)line[len - 1])) line[--len] = '\0'; while (isspace((unsigned char)*cp)) cp++; -- 2.40.0