KvasirSecurity/Kvasir — pull request #81 by andurin (2014-05-16 09:56:21+00:00)
Title: nmap-import: Use safe method to access dict

Stepped on this bug while importing nmap xml file ended up in
a python keyerror.

Solved by first check if cpe exists through dict.get() as safe method.

See also:
```python
Traceback (most recent call last):
File "/opt/web2py/gluon/restricted.py", line 220, in restricted
exec ccode in environment
File "/opt/web2py/applications/kvasir/controllers/nmap.py", line 245, in
File "/opt/web2py/gluon/globals.py", line 389, in
self._caller = lambda f: f()
File "/opt/web2py/gluon/tools.py", line 3283, in f
return action(*a, **b)
File "/opt/web2py/applications/kvasir/controllers/nmap.py", line 145, in import_xml_scan
update_hosts=form.vars.f_update_hosts,
File "applications/kvasir/modules/skaldship/nmap.py", line 183, in process_xml
f_cpename= k['cpe'].lstrip('cpe:/o:')
KeyError: 'cpe'
```