diff --git a/CHANGELOG b/CHANGELOG index 7a87ea722..681952810 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,9 @@ # Nmap Changelog ($Id$); -*-text-*- +o [Ndiff] Added a workaround for a bug in PyXML. The bug would cause a + crash that looked like "KeyError: 0". Fyodor reported the error. + [David] + o [Zenmap] Fixed a crash when something that looked like a format specifier (like %y) appeared in a profile. The error message was ValueError: unsupported format character 'y' (0x79) diff --git a/ndiff/ndiff b/ndiff/ndiff index e58031d2b..74249acf0 100755 --- a/ndiff/ndiff +++ b/ndiff/ndiff @@ -543,7 +543,7 @@ class NmapContentHandler(xml.sax.handler.ContentHandler): def startElementAux(self, name, attrs): if name == u"nmaprun": assert self.parent_element() == None - if u"start" in attrs: + if attrs.has_key(u"start"): start_timestamp = int(attrs.get(u"start")) self.scan.start_date = datetime.datetime.fromtimestamp(start_timestamp) elif name == u"scaninfo": @@ -633,14 +633,14 @@ class NmapContentHandler(xml.sax.handler.ContentHandler): assert self.current_host is not None if self.current_spec is None: return - if u"state" not in attrs: + if not attrs.has_key(u"state"): warn("state element of port %s is missing the \"state\" attribute; assuming \"unknown\"." % Port.spec_to_string(self.current_spec)) return state = attrs[u"state"] self.current_host.add_port(self.current_spec, state) elif name == u"finished": assert self.parent_element() == u"runstats" - if u"time" in attrs: + if attrs.has_key(u"time"): end_timestamp = int(attrs.get(u"time")) self.scan.end_date = datetime.datetime.fromtimestamp(end_timestamp)