Skip to content

Commit 3e481eb

Browse files
authored
Merge pull request savon-noir#73 from Deedasmi/master
Small fixes - merged to master
2 parents 7f79f9d + 112897a commit 3e481eb

File tree

3 files changed

+11
-3
lines changed

3 files changed

+11
-3
lines changed

libnmap/objects/cpe.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ class CPE(object):
1111
"""
1212
def __init__(self, cpestring):
1313
self._cpestring = cpestring
14-
self.cpedict = {}
15-
1614
zk = ['cpe', 'part', 'vendor', 'product', 'version',
1715
'update', 'edition', 'language']
1816
self._cpedict = dict((k, '') for k in zk)
@@ -26,6 +24,13 @@ def cpestring(self):
2624
"""
2725
return self._cpestring
2826

27+
@property
28+
def cpedict(self):
29+
"""
30+
Accessor for _cpedict
31+
"""
32+
return self._cpedict
33+
2934
def __repr__(self):
3035
return self._cpestring
3136

libnmap/objects/host.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,9 @@ def extraports_reasons(self):
467467
"""
468468
r = self._extras.get('extraports', {})
469469

470+
if r is None:
471+
return None
472+
470473
return r.get('reasons', None)
471474

472475
def get_dict(self):

libnmap/objects/report.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def scan_type(self):
110110
111111
:return: string
112112
"""
113-
return self._scaninfo['type']
113+
return self._scaninfo.get('type')
114114

115115
@property
116116
def hosts(self):

0 commit comments

Comments
 (0)