diff options
author | Alan T. DeKok <aland@freeradius.org> | 2016-05-17 11:23:16 -0400 |
---|---|---|
committer | Alan T. DeKok <aland@freeradius.org> | 2016-05-17 11:23:16 -0400 |
commit | d063d8b431ad025f753d101a211ea8ddf742fd64 (patch) | |
tree | d2fd9d0d39da4660da703ebc12bffdc0615b1693 /src/pam_radius_auth.c | |
parent | 27d4d321f41ad988e3c4245c78c9b38a3ff30a32 (diff) | |
download | libpam-radius-auth-d063d8b431ad025f753d101a211ea8ddf742fd64.tar.gz libpam-radius-auth-d063d8b431ad025f753d101a211ea8ddf742fd64.zip |
Check for too long lines
Diffstat (limited to 'src/pam_radius_auth.c')
-rw-r--r-- | src/pam_radius_auth.c | 19 |
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; |