From f62e36ce55fe5d59572020bd1c1085005358f39d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dag-Erling=20Sm=C3=B8rgrav?= Date: Wed, 13 Feb 2002 00:34:23 +0000 Subject: [PATCH] Fix an off-by-one bug that would in some circumstances trim off the last character of a configuration line. Sponsored by: DARPA, NAI Labs git-svn-id: svn+ssh://svn.openpam.org/svn/openpam/trunk@49 185d5e19-27fe-0310-9dcf-9bff6b9f3609 --- lib/pam_start.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/pam_start.c b/lib/pam_start.c index ff9cc32..a059661 100644 --- a/lib/pam_start.c +++ b/lib/pam_start.c @@ -132,7 +132,7 @@ _pam_read_policy_file(pam_handle_t *pamh, /* strip comments and trailing whitespace */ if ((p = strchr(buf, '#')) != NULL) len = p - buf ? p - buf - 1 : p - buf; - while (len > 0 && isspace(buf[len])) + while (len > 0 && isspace(buf[len - 1])) --len; if (len == 0) continue;