diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2009-05-13 18:01:32 +0200 |
---|---|---|
committer | Kay Sievers <kay.sievers@vrfy.org> | 2009-05-13 18:01:32 +0200 |
commit | 0c37798916bc87d72f5f1399d9e050307901db84 (patch) | |
tree | 362ea9a9331f74891cb5dc9b4cffd904f9ca5fa1 /udev | |
parent | 6205f1186e4980544ea425d31770358d1b2579e4 (diff) |
fix possible endless loop for GOTO to non-existent LABEL
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=526365
Diffstat (limited to 'udev')
-rw-r--r-- | udev/udev-rules.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/udev/udev-rules.c b/udev/udev-rules.c index fac418e526..b8b7e52c83 100644 --- a/udev/udev-rules.c +++ b/udev/udev-rules.c @@ -1610,6 +1610,7 @@ static int parse_file(struct udev_rules *rules, const char *filename, unsigned s if (strcmp(label, &rules->buf[rules->tokens[j].rule.label_off]) != 0) continue; rules->tokens[i].key.rule_goto = j; + break; } if (rules->tokens[i].key.rule_goto == 0) err(rules->udev, "GOTO '%s' has no matching label in: '%s'\n", label, filename); @@ -2504,6 +2505,8 @@ int udev_rules_apply_to_event(struct udev_rules *rules, struct udev_event *event break; } case TK_A_GOTO: + if (cur->key.rule_goto == 0) + break; cur = &rules->tokens[cur->key.rule_goto]; continue; case TK_A_LAST_RULE: |