{
int was_whitespace = 0;
- while (*s && *s != c && !(was_whitespace && *s == ';')) {
+ while (*s && *s != c && (!was_whitespace || *s != ';')) {
was_whitespace = isspace((unsigned char) (*s));
s++;
}
* Valid name[=:]value pair found, call
* handler
*/
+ if (strlen(name) >= sizeof(prev_name)) {
+ /* Truncation occurs, report an error. */
+ error = lineno;
+ }
strncpy0(prev_name, name, sizeof(prev_name));
if (handler(user, section, name, value) < 0 && !error) {
error = lineno;