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

QDrag with invalid URLs in QMimeData crash on macOS

    XMLWordPrintable

Details

    • macOS
    • da951c9dbf (qt/qtbase/dev) da951c9dbf (qt/tqtc-qtbase/dev) 599c87893b (qt/tqtc-qtbase/5.15) 081a6467ad (qt/tqtc-qtbase/6.2) f8fcc89ca7 (qt/qtbase/6.3) f8fcc89ca7 (qt/tqtc-qtbase/6.3) 398d5d6038 (qt/qtbase/6.4) 398d5d6038 (qt/tqtc-qtbase/6.4)

    Description

      As soon as there are multiple URLs, one of them being invalid, it crashes on drag.

      Here's an example that triggers it:

      import QtQuick
      import QtQuick.Controls
      
      ApplicationWindow {
          id: window
          width: 600
          height: 400
          visible: true
          
          Item {
              anchors.fill: parent
              
              Rectangle {
                  id: myItem
      
                  width: 100
                  height: 60
                  color: "green"
                  
                  Drag.active: dragArea.drag.active
                  Drag.dragType: Drag.Automatic
                  Drag.mimeData: {
                      "text/uri-list": "file:///some/valid/path\nsome_invalid_url"
                  }
              
                  MouseArea {
                      id: dragArea
                      anchors.fill: parent
                      drag.target: parent
                  }
              }
          }
      }
      

      Stack trace is attached.

      Environment:

      OS: macOS 12.5
      Arch: ARM 64

      Attachments

        1. invalidURL.tar.gz
          1 kB
        2. stack.txt
          9 kB

        Issue Links

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

          Activity

            People

              tpochep Timur Pocheptsov
              marcel.gotsch Marcel Gotsch
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: