summaryrefslogtreecommitdiff
path: root/udev_rules.c
diff options
context:
space:
mode:
authorHarald Hoyer <harald@redhat.com>2007-09-11 17:17:29 +0200
committerKay Sievers <kay.sievers@vrfy.org>2007-09-11 17:17:29 +0200
commit16511863d928e7fd82f15ae64850ab21e74f0f16 (patch)
tree0a0ad903a190103eb8aeb982ba1456813f07b9f3 /udev_rules.c
parentb1ac36ff5e3756cefc79967a26280056da31bf6f (diff)
check line length after comment check and whitespace strip
Diffstat (limited to 'udev_rules.c')
-rw-r--r--udev_rules.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/udev_rules.c b/udev_rules.c
index dcd091485b..3ec8477461 100644
--- a/udev_rules.c
+++ b/udev_rules.c
@@ -349,11 +349,6 @@ static int import_keys_into_env(struct udevice *udev, const char *buf, size_t bu
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++;
@@ -366,6 +361,11 @@ static int import_keys_into_env(struct udevice *udev, const char *buf, size_t bu
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';