Repository navigation
add bounds check for country code table - #3811
Conversation
| // Qt6 changed those IDs, so we have to convert back: | ||
| if ( iCountryCode >= qt6CountryToWireFormatLen ) | ||
| { | ||
| return QLocale::AnyCountry; |
There was a problem hiding this comment.
What should we return otherwise?
There was a problem hiding this comment.
There doesn't seem to exist any better alternative than this.
|
|
||
| if ( iIdx >= qt6CountryToWireFormatLen ) | ||
| { | ||
| return 0; |
There was a problem hiding this comment.
Not sure what to return...
There was a problem hiding this comment.
I think this is correct, because it is the Qt5 value for QLocale::AnyCountry, which is sent on the wire if a country is explicitly not defined.
If a server does not specify --serverinfo, or leaves the country code blank, such as --serverinfo 'My Server;London;', then it gets replaced by the country of the system locale. If the server operator doesn't want a country to show (and there are a small number like that), they need explicitly to give a code of 0: --serverinfo 'My Server;;0'
|
Again with this, merge to main initially, then PR onto release/3_12. |
|
Are you sure that you do not want a git cherry pick with one PR including all or most of the bugfixes? |
I'd rather not a single PR. Group related commits cherry-picked over into single PRs, yes but I'd still like a structured history for things like |
|
Backported to release/3_12 |
Short description of changes
Adds bounds check for qt6 country code conversion (also found like #3810 )
CHANGELOG: Add bounds checking for country code lookup
Context: Fixes an issue?
/
Does this change need documentation? What needs to be documented and how?
No
Status of this Pull Request
Ready for review (didn't analyze this one deeply). The style follows isCountryCodeSupported. Alternatively, we could probably just call IsCountryCode supported as guard?
What is missing until this pull request can be merged?
Review, analysis.
Checklist