Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-138562

QLocalePrivate::codeToLanguage() does not sanitize the input before passing it to AlphaCode

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.6.3, 6.7.3, 6.8.4, 6.9.1, 6.10.0 Beta2
    • Core: Locales (i18n)
    • None
    • 2
    • f3e240e40 (dev), 01d0c4f8d (tqtc/lts-6.5), 6fd54f56d (6.10), 10a2b5745 (6.9), ab2b6d371 (dev), bf66ec2ff (tqtc/lts-6.8), 3d919b60a (tqtc/lts-6.5), 053c99931 (6.10), 6995beccb (6.9), 0b1c0d6f4 (tqtc/lts-6.8), 7806a9e5b (tqtc/lts-6.5)
    • Foundation Sprint 134, Foundation Sprint 135, Foundation Sprint 136, Foundation Sprint 137, Foundation Sprint 138

      qtbase/3dcd6b7ec98b2edf9654bcefdb83134c4c3d2a38 changed AlphaCode from a char[4] to an uint16_t c1:5, c2:5, c3:5, reserved:1, halving the structure size from four to 2 bytes, but also adding the precondition that the AlphaCode(char, char, char) ctor no longer accepts arbitrary char values, but only those inside the set {'\0', 'a'...'z'} (plus a few theoretical characters above 'z' that are unused, but would still fit into the 5-bit bit-fields).

      The QLocale::codeToLanguage() function, by way of QLocalePrivate::codeToLanguage(), only checks input characters for being <= 0x7F, but that is no longer sufficient. It has to check for <= 'z' && (== 0 || >= 'a') instead.

        For Gerrit Dashboard: QTBUG-138562
        # Subject Branch Project Status CR V

            mmutz Marc Mutz
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: