Opened 19 months ago
Last modified 19 months ago
#18389 new bug
[TextSearch] crash on files with long lines.
Reported by: | bipolar | Owned by: | phoudoin |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Applications/TextSearch | Version: | R1/beta4 |
Keywords: | Cc: | ||
Blocked By: | Blocking: | ||
Platform: | x86 |
Description (last modified by )
Steps to reproduce:
Save a copy of system_logging.html locally, run > TestSearch system_logging.html
, type "test" on the search input box, hit enter.
Will attach .report file next.
Could be related to #17011, but I'm not entirely sure (this one consistenly shows crash on _IO_vfscanf).
Attachments (1)
Change History (10)
by , 19 months ago
Attachment: | TextSearch-4618-debug-26-04-2023-06-21-44.report added |
---|
comment:1 by , 19 months ago
Description: | modified (diff) |
---|
comment:2 by , 19 months ago
Description: | modified (diff) |
---|
follow-up: 7 comment:5 by , 19 months ago
I think here it's a bug in TextSearch, in Grepper.cpp. The line buffer handed to sscanf() to extract the filename, line number and position is sized to B_PATH_NAME_LENGTH * 2. Which gives only 2048 max, AFAICT.
If the actual line read from grep output is longer than that, I fear that there is no \0 at end of the line buffer, which lead to sscanf() stepping outside memory boundary and therefore crash.
comment:6 by , 19 months ago
Another way to fix it is to use strtok() instead of sscanf() to parse the grep ouput lines.
follow-up: 8 comment:7 by , 19 months ago
comment:8 by , 19 months ago
comment:9 by , 19 months ago
Platform: | All → x86 |
---|
Crash on beta4 32 bits