From mboxrd@z Thu Jan 1 00:00:00 1970 From: Harald Hoyer Date: Mon, 10 Sep 2007 07:56:57 +0000 Subject: [PATCH] check file length after comment check and whitespace strip Message-Id: <11894110191554-git-send-email-harald@redhat.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org --- udev_config.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/udev_config.c b/udev_config.c index 3f226b9..2f2a69e 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'; -- 1.5.2.4 ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2005. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel