From 16511863d928e7fd82f15ae64850ab21e74f0f16 Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Tue, 11 Sep 2007 17:17:29 +0200 Subject: check line length after comment check and whitespace strip --- udev_config.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'udev_config.c') diff --git a/udev_config.c b/udev_config.c index 3f226b9d7c..2f2a69eb48 100644 --- a/udev_config.c +++ b/udev_config.c @@ -111,11 +111,6 @@ static int parse_config_file(void) cur += count+1; lineno++; - if (count >= sizeof(line)) { - err("line too long, conf line skipped %s, line %d", udev_config_filename, lineno); - continue; - } - /* eat the whitespace */ while ((count > 0) && isspace(bufline[0])) { bufline++; @@ -128,6 +123,11 @@ static int parse_config_file(void) if (bufline[0] == COMMENT_CHARACTER) continue; + if (count >= sizeof(line)) { + err("line too long, conf line skipped %s, line %d", udev_config_filename, lineno); + continue; + } + memcpy(line, bufline, count); line[count] = '\0'; -- cgit v1.2.3-54-g00ecf