Edgewall Software

Ticket #2707 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

String index out of range

Reported by: littleb Owned by: jonas
Priority: high Milestone: 0.9.4
Component: search system Version: 0.9.3
Severity: major Keywords:
Cc:

Description

 http://example.com/trac/search?q=%de

string index out of range

Python traceback

Traceback (most recent call last):
  File "/usr/share/python2.4/site-packages/trac/web/modpython_frontend.py", line 206, in handler
  File "/usr/share/python2.4/site-packages/trac/web/main.py", line 139, in dispatch_request
  File "/usr/share/python2.4/site-packages/trac/web/main.py", line 107, in dispatch
  File "/usr/share/python2.4/site-packages/trac/Search.py", line 146, in process_request
  File "/usr/share/python2.4/site-packages/trac/Search.py", line 224, in quickjump
IndexError: string index out of range

Attachments

Change History

Changed 3 years ago by Manuzhai

I cannot reproduce this on projects.edgewall.com/trac/ at this time.

Changed 3 years ago by Manuzhai

Nor on my internal source:/trunk/@2861 installation.

Changed 3 years ago by mgood

  • status changed from new to closed
  • resolution set to worksforme

I can't reproduce either. Trac requires a query string of at least 3 characters, so the above query is rejected since it's too short.

Changed 3 years ago by anonymous

  • status changed from closed to reopened
  • resolution worksforme deleted
python-2.4.2
apache-2.2.0
apache-mod_python-3.1.4
default_charset = utf-8

see this

Changed 3 years ago by mgood

  • status changed from reopened to closed
  • resolution set to worksforme

Your config doesn't change the fact that you need to enter a query of at least 3 characters, and your example above only includes 1 character in the search string. Please check if you've made local modifications that are broken, or provide more information to reproduce the problem.

Changed 3 years ago by anonymous

  • status changed from closed to reopened
  • resolution worksforme deleted

Try instead searching for the letter F.

It looks like the quickjump code is run before the length check. This is probably so that #1 takes you to ticket:1 instead of telling you your query is too short. If you enter just one letter and it is upper case the bug is triggered. That is, kwd[0].isupper() passes and kwd[1].islower() raises the IndexError?. Adding a len(kwd) > 1 at the front of the elif test or as guard to the whole function (as none of the clauses can pass with len <= 1) should fix it.

Changed 3 years ago by cboos

  • status changed from reopened to closed
  • summary changed from [mod_python] String index out of range to String index out of range
  • resolution set to fixed
  • milestone set to 0.9.4

Thanks for the clarification. Fixed in r2863 and r2864.

Add/Change #2707 (String index out of range)

Author



Change Properties
<Author field>
Action
as closed
Next status will be 'reopened'
to The owner will change from jonas. Next status will be 'closed'
 
Note: See TracTickets for help on using tickets.