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

Review toupper use [qtvirtualkeyboard]

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.2.6, 6.4.1, 6.5.0 FF
    • Virtual Keyboard
    • None
    • Linux/X11

      This is a spin off from QTBUG-109235, please see there for more info.

      I have a hard time deciding whether the tolower() call here:

      qtvirtualkeyboard/tests/manual/x11vkbwrapper/handlekeyevents.cpp:    KeySym keyS = upper ? keySym : static_cast<unsigned long>(tolower(static_cast<int>(keySym)));
      

      is genuinely supposed to map I to ı (LATIN SMALL LETTER DOTLESS I) in the Türkiye locale, or whether it shouldn't still be i. If it is, then the code is wrong, because tolower('I') will likely return I, then, since ı isn't representable. So the code is wrong, either way. The question is what the fix should be.

      The code also seems to run into UB, by passing KeySym values unchecked into tolower, which is defined only for [0..255] uchar values, and EOF.

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            jakoivik Jarkko Koivikko
            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:

                There are no open Gerrit changes