Skip to contentSkip to conversation

check file length after comment check and whitespace strip

PATCH Applied Harald Hoyer 2 participants 2 messages Sep 10, 2007 – Sep 11, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 check file length after comment check and whitespace strip

---
 udev_config.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
udev_config.c +5 -5
index 3f226b9..2f2a69e 100644
@@ -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';
 
Signature · 11 lines
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel
Applied
#1 lore raw
Quoted 3 lines · Harald Hoyer
---
 udev_config.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

Applied.

Thanks,
Kay

-------------------------------------------------------------------------
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
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel