From 6d691b2bd669ea0bb3472a7a7d86780dd351977f Mon Sep 17 00:00:00 2001 From: Florian Zumbiehl Date: Tue, 1 Sep 2009 13:26:37 +0200 Subject: [PATCH] udev-rules.c: parse_file() - fix possible buffer overflow --- udev/udev-rules.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/udev/udev-rules.c b/udev/udev-rules.c index 4d9fa70a..da08bc11 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); } -- 2.39.5