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

qstylesheetstyle.cpp position() pointer is accessed before checking hasPosition()

    XMLWordPrintable

Details

    • Windows
    • 674747bac1c8b57d4940de2ee68b6b562dfcad61 (qt/qtbase/dev) 1c0c2c4dedfb0ac4ab1951afe2c6b332368f6d6c (qt/qtbase/6.0) 42f364c4945b7fe504817c5dc24f3ab8a4456dbd (qt/qtbase/6.1) 9b23b3013b4e14a74ee1188836c334a767edaee8 (qt/tqtc-qtbase/tqtc/lts-5.15)

    Description

      Hi,

      In QStyleSheetStyle::drawControl , in case CE_PushButtonLabel, the following code is crashing as it accesses a null pointer by calling rule.position()->textAlignment before checking it's null with rule.hasPosition :

       

       const Qt::Alignment textAlignment = rule.position()->textAlignment;
       if (rule.hasPosition() && textAlignment != 0) {
      

       

       

      Attachments

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

        Activity

          People

            vhilshei Volker Hilsheimer
            pierre31 Pierre
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: