xiaoyifang / goldendict-ng

The Next Generation GoldenDict
https://xiaoyifang.github.io/goldendict-ng/
Other
1.71k stars 95 forks source link

fix: a DICT crash caused by string out of bound access #1944

Closed shenlebantongying closed 1 week ago

shenlebantongying commented 1 week ago

Crash site:

reply is wn ".

A combination of 2 factors:

Original GD's code assumes " " is a pair, and access the string by index.

New code doesn't wait for response to ready.


It for some reason reliably crash for me when searching "get" and always end with a incomplete wn ". I thought it is just out of bound access, but looking into the website reveals that three are a few more words aren't arrived. It always reaches gettable. (Does this mean dict.org is hosted on a single machine and my latency to this machine is a constant and thus it always crash at that point 😅 )

sonarcloud[bot] commented 1 week ago

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code

See analysis details on SonarQube Cloud