diff options
| author | Sebastian Heinlein <sebastian.heinlein@web.de> | 2006-03-25 10:52:05 +0100 |
|---|---|---|
| committer | Sebastian Heinlein <sebastian.heinlein@web.de> | 2006-03-25 10:52:05 +0100 |
| commit | 3aa98f64592d44a6c65ad1bac11e03292c7deb39 (patch) | |
| tree | 28f6db199542bf6797f07b2153e7da2560368aa2 | |
| parent | c27b003ea0fceb92b42bd1633832d1c5eb902a5a (diff) | |
| download | python-apt-3aa98f64592d44a6c65ad1bac11e03292c7deb39.tar.gz | |
* add some sanity checking to aptsources
| -rw-r--r-- | SoftwareProperties/aptsources.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/SoftwareProperties/aptsources.py b/SoftwareProperties/aptsources.py index 77de510b..53ae2e84 100644 --- a/SoftwareProperties/aptsources.py +++ b/SoftwareProperties/aptsources.py @@ -102,8 +102,16 @@ class SourceEntry: line = line[:i] # source is ok, split it and see what we have pieces = self.mysplit(line) + # Sanity check + if len(pieces) < 3: + self.invalid = True + return # Type, deb or deb-src self.type = string.strip(pieces[0]) + # Sanity check + if self.type not in ("deb", "deb-src"): + self.invalid = True + return # URI self.uri = string.strip(pieces[1]) # distro and components (optional) |
