PidgeyL / cve-search

cve-search is a tool to import CVE (Common Vulnerabilities and Exposures) and CPE (Common Platform Enumeration) into a MongoDB to facilitate search and processing of CVEs.
http://adulau.github.com/cve-search/
Other
24 stars 4 forks source link

Weird issue when searching for 'sap' in the index.py web interface #131

Closed lvets closed 7 years ago

lvets commented 7 years ago

Hi,

When I search for sap in the web interface, I get the following error:

192.168.56.1 - - [23/Feb/2017 14:15:03] "POST /search HTTP/1.1" 500 -
Traceback (most recent call last):
  File "/home/laurens/Source/py3venv/lib/python3.5/site-packages/flask/app.py", line 1994, in __call__
    return self.wsgi_app(environ, start_response)
  File "/home/laurens/Source/py3venv/lib/python3.5/site-packages/flask/app.py", line 1985, in wsgi_app
    response = self.handle_exception(e)
  File "/home/laurens/Source/py3venv/lib/python3.5/site-packages/flask/app.py", line 1540, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/home/laurens/Source/py3venv/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/laurens/Source/py3venv/lib/python3.5/site-packages/flask/app.py", line 1982, in wsgi_app
    response = self.full_dispatch_request()
  File "/home/laurens/Source/py3venv/lib/python3.5/site-packages/flask/app.py", line 1614, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/home/laurens/Source/py3venv/lib/python3.5/site-packages/flask/app.py", line 1517, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File "/home/laurens/Source/py3venv/lib/python3.5/site-packages/flask/_compat.py", line 33, in reraise
    raise value
  File "/home/laurens/Source/py3venv/lib/python3.5/site-packages/flask/app.py", line 1612, in full_dispatch_request
    rv = self.dispatch_request()
  File "/home/laurens/Source/py3venv/lib/python3.5/site-packages/flask/app.py", line 1598, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/laurens/Source/cve-search/web/minimal.py", line 206, in freetext_search
    result = db.getSearchResults(search)
  File "/home/laurens/Source/cve-search/lib/DatabaseLayer.py", line 201, in getSearchResults
    entry['reason']=collection['n']
TypeError: 'NoneType' object does not support item assignment

Strangely enough, searching for for instance 'cisco' is fine... Any idea what might wrong?

PidgeyL commented 7 years ago

This should fix it :) Thanks for reporting this!

lvets commented 7 years ago

Can you also apply this fix to the main branch? Or should we be running api_reworking branch?

PidgeyL commented 7 years ago

Right! Sorry, I forgot I was in my development branch... I'll push it to the main one tomorrow.

-----Original Message----- From: "LaurensV" notifications@github.com Sent: ‎28/‎02/‎2017 17:14 To: "PidgeyL/cve-search" cve-search@noreply.github.com Cc: "Pidgey" pieterjan.moreels@gmail.com; "State change" state_change@noreply.github.com Subject: Re: [PidgeyL/cve-search] Weird issue when searching for 'sap' in theindex.py web interface (#131)

Can you also apply this fix to the main branch? Or should we be running api_reworking branch? — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

PidgeyL commented 6 years ago

hello