Skip to content

add bounds check for country code table#3811

Open
ann0see wants to merge 1 commit into
jamulussoftware:mainfrom
ann0see:fix/next
Open

add bounds check for country code table#3811
ann0see wants to merge 1 commit into
jamulussoftware:mainfrom
ann0see:fix/next

Conversation

@ann0see

@ann0see ann0see commented Jul 20, 2026

Copy link
Copy Markdown
Member

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

  • I've verified that this Pull Request follows the general code principles
  • I tested my code and it does what I want (as in - it compiles with qt6 and seemed to show countries correctly - but not 100% sure)
  • My code follows the style guide
  • I waited some time after this Pull Request was opened and all GitHub checks completed without errors.
  • I've filled all the content above

Comment thread src/util.cpp
// Qt6 changed those IDs, so we have to convert back:
if ( iCountryCode >= qt6CountryToWireFormatLen )
{
return QLocale::AnyCountry;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What should we return otherwise?

Comment thread src/util.cpp

if ( iIdx >= qt6CountryToWireFormatLen )
{
return 0;

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what to return...

@ann0see
ann0see requested a review from softins July 20, 2026 13:51
@ann0see ann0see added the bug Something isn't working label Jul 20, 2026
@github-project-automation github-project-automation Bot moved this to Triage in Tracking Jul 20, 2026
@ann0see ann0see added this to the 3.12.3 milestone Jul 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

1 participant