summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlan T. DeKok <aland@freeradius.org>2016-05-17 11:23:16 -0400
committerAlan T. DeKok <aland@freeradius.org>2016-05-17 11:23:16 -0400
commitd063d8b431ad025f753d101a211ea8ddf742fd64 (patch)
treed2fd9d0d39da4660da703ebc12bffdc0615b1693 /src
parent27d4d321f41ad988e3c4245c78c9b38a3ff30a32 (diff)
downloadlibpam-radius-auth-d063d8b431ad025f753d101a211ea8ddf742fd64.tar.gz
libpam-radius-auth-d063d8b431ad025f753d101a211ea8ddf742fd64.zip
Check for too long lines
Diffstat (limited to 'src')
-rw-r--r--src/pam_radius_auth.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/pam_radius_auth.c b/src/pam_radius_auth.c
index 5a60fa0..e9b3034 100644
--- a/src/pam_radius_auth.c
+++ b/src/pam_radius_auth.c
@@ -619,17 +619,22 @@ static int initialize(radius_conf_t *conf, int accounting)
p = buffer;
/*
- * Skip blank lines and whitespace
+ * Skip whitespace
*/
- while (*p && ((*p == ' ') || (*p == '\t') || (*p == '\r') || (*p == '\n'))) {
- p++;
- }
+ while ((*p == ' ') || (*p == '\t')) p++;
/*
- * Nothing, or just a comment. Ignore the line.
+ * Skip blank lines and comments.
*/
- if ((!*p) || (*p == '#')) {
- continue;
+ if ((*p == '\r') || (*p == '\n') || (*p == '#')) continue;
+
+ /*
+ * Error out if the text is too long.
+ */
+ if (!*p) {
+ _pam_log(LOG_ERR, "ERROR reading %s, line %d: Line too long\n",
+ conf_file, line);
+ break;
}
timeout = 3;