summaryrefslogtreecommitdiff
path: root/udev/udev-rules.c
diff options
context:
space:
mode:
authorFlorian Zumbiehl <florz@florz.de>2009-09-01 13:26:37 +0200
committerKay Sievers <kay.sievers@vrfy.org>2009-09-01 13:26:37 +0200
commit6d691b2bd669ea0bb3472a7a7d86780dd351977f (patch)
tree0b98edde877831e179b4d733ef54348a6cc7de7b /udev/udev-rules.c
parent710fdac1e49276683abe927472fe1b336960edd8 (diff)
udev-rules.c: parse_file() - fix possible buffer overflow
Diffstat (limited to 'udev/udev-rules.c')
-rw-r--r--udev/udev-rules.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c
index 4d9fa70ae5..da08bc11f6 100644
--- a/udev/udev-rules.c
+++ b/udev/udev-rules.c
@@ -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);
}