diff --git a/test/udev-test.pl b/test/udev-test.pl index 9a88d06271..63715ac093 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -1498,6 +1498,18 @@ EOF rules => < "overlong comment line", + subsys => "block", + devpath => "/block/sda/sda1", + exp_name => "yes", + rules => <= sizeof(line)) { - err("line too long, rule skipped '%s:%u'", filename, lineno); - continue; - } - /* eat the whitespace */ while ((count > 0) && isspace(bufline[0])) { bufline++; @@ -620,7 +615,12 @@ static int parse_file(struct udev_rules *rules, const char *filename) if (bufline[0] == COMMENT_CHARACTER) continue; - /* skip backslash and newline from multi line rules */ + if (count >= sizeof(line)) { + err("line too long, rule skipped '%s:%u'", filename, lineno); + continue; + } + + /* skip backslash and newline from multiline rules */ for (i = j = 0; i < count; i++) { if (bufline[i] == '\\' && bufline[i+1] == '\n') continue;