udev-rules.c: parse_file() - fix possible buffer overflow

This commit is contained in:
Florian Zumbiehl
2009-09-01 13:26:37 +02:00
committed by Kay Sievers
parent 710fdac1e4
commit 6d691b2bd6
+2
View File
@@ -1599,6 +1599,8 @@ static int parse_file(struct udev_rules *rules, const char *filename, unsigned s
while (line[len-2] == '\\') {
if (fgets(&line[len-2], (sizeof(line)-len)+2, f) == NULL)
break;
if (strlen(&line[len-2]) < 2)
break;
line_nr++;
len = strlen(line);
}