Skip to content

Host lookup in service formatting fails #171

@mwulftange

Description

@mwulftange

The host lookup db.t_hosts[r.f_hosts_id] in the formatting function for services in models/db_02_kvasir.py fails when trying to edit a vulnerability of a service (…/vulns/service_vulns_edit.html/123) with the following trace:

Traceback (most recent call last):
  File "/opt/web2py/gluon/restricted.py", line 224, in restricted
    exec ccode in environment
  File "/opt/web2py/applications/kvasir/controllers/vulns.py", line 807, in <module>
  File "/opt/web2py/gluon/globals.py", line 392, in <lambda>
    self._caller = lambda f: f()
  File "/opt/web2py/gluon/tools.py", line 3449, in f
    return action(*a, **b)
  File "/opt/web2py/applications/kvasir/controllers/vulns.py", line 491, in service_vulns_edit
    onaccept=crud.archive)
  File "/opt/web2py/gluon/tools.py", line 4066, in update
    **attributes # contains hidden
  File "/opt/web2py/gluon/sqlhtml.py", line 1230, in __init__
    inp = self.widgets.options.widget(field, default)
  File "/opt/web2py/gluon/sqlhtml.py", line 289, in widget
    options = requires[0].options()
  File "/opt/web2py/gluon/validators.py", line 579, in options
    self.build_set()
  File "/opt/web2py/gluon/validators.py", line 576, in build_set
    self.labels = [self.label(r) for r in records]
  File "/opt/web2py/applications/kvasir/models/db_02_kvasir.py", line 81, in <lambda>
    format=lambda r:XML("%s :: %s/%s" % (db.t_hosts[r.f_hosts_id].f_ipaddr, r.f_proto, r.f_number)),
AttributeError: 'NoneType' object has no attribute 'f_ipaddr'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions