From 3ffd2176fea960f550ea27be750ad90d79c2c76f Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 9 Feb 2010 03:20:45 +0000 Subject: [PATCH] Make Glsa constructor raise GlsaFormatException when a package name attribute is invalid. svn path=/main/trunk/; revision=15328 --- pym/portage/glsa.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pym/portage/glsa.py b/pym/portage/glsa.py index 4684ea420..98602e4cc 100644 --- a/pym/portage/glsa.py +++ b/pym/portage/glsa.py @@ -11,6 +11,7 @@ except ImportError: import re import xml.dom.minidom +import portage from portage import os from portage import _encodings from portage import _unicode_decode @@ -551,6 +552,13 @@ class Glsa: self.packages = {} for p in self.affected.getElementsByTagName("package"): name = p.getAttribute("name") + try: + name = portage.dep.Atom(name) + except portage.exception.InvalidAtom: + raise GlsaFormatException(_("invalid package name: %s") % name) + if name != name.cp: + raise GlsaFormatException(_("invalid package name: %s") % name) + name = name.cp if name not in self.packages: self.packages[name] = [] tmp = {} -- 2.26.2