From da69fb39ca90793142df1cf6a3488deb692cbeff Mon Sep 17 00:00:00 2001 From: "Adam D. Barratt" Date: Sun, 1 Apr 2012 22:46:05 +0000 Subject: [PATCH] Perform basic sanity checking when reading hints files The only test currently implemented is to ensure that any prospective hint contains at least one item beyond the hint name. This prevents lines in a hint file consisting simply of e.g. "easy" being added to the hint list and causing later processing to abort with an error. Signed-off-by: Adam D. Barratt --- britney.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/britney.py b/britney.py index b2c55ef..484c690 100755 --- a/britney.py +++ b/britney.py @@ -813,6 +813,9 @@ class Britney(object): break elif l[0] not in self.HINTS[who]: continue + elif len(l) == 1: + # All current hints require at least one argument + self.__log("Malformed hint found in %s: '%s'" % (filename, line), type="W") elif l[0] in ["approve", "block", "block-all", "block-udeb", "unblock", "unblock-udeb", "force", "urgent", "remove"]: for package in l[1:]: hints.add_hint('%s %s' % (l[0], package), who)