chiark / gitweb /
udev-rules.c: parse_file() - fix possible buffer overflow
authorFlorian Zumbiehl <florz@florz.de>
Tue, 1 Sep 2009 11:26:37 +0000 (13:26 +0200)
committerKay Sievers <kay.sievers@vrfy.org>
Tue, 1 Sep 2009 11:26:37 +0000 (13:26 +0200)
udev/udev-rules.c

index 4d9fa70ae54fe4193884e2043fddf92398262abe..da08bc11f69668a807e675743757da033fc76dee 100644 (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);
                }