Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: makeFTSIndex crash at startup when indexed articleCount is zero #1198

Merged
merged 2 commits into from
Oct 6, 2023

Conversation

shenlebantongying
Copy link
Collaborator

@shenlebantongying shenlebantongying commented Oct 6, 2023

The behaviour of &QList::front() is undefined if the size is 0 https://doc.qt.io/qt-6/qlist.html#first

I don't fully understand the context, this may reveal other bugs if the offsets' size is not supposed to be 0.

image

@shenlebantongying
Copy link
Collaborator Author

shenlebantongying commented Oct 6, 2023

I forget where did I downloaded this test file but it will trigger the crash reliably.

(The dict file is a broken one btw (invalid xml))

dict.xdxf.zip

@sonarqubecloud
Copy link

sonarqubecloud bot commented Oct 6, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@xiaoyifang xiaoyifang merged commit 649cf17 into xiaoyifang:staged Oct 6, 2023
13 checks passed
@shenlebantongying shenlebantongying deleted the fts_crash branch March 21, 2024 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants