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

Limiting maximum allocation size for QDataStream

    XMLWordPrintable

Details

    • Linux/X11
    • e696bec76 (dev), 60d60dba7 (6.7), 06618fbeb (6.6), b7792d9b8 (tqtc/lts-6.5)

    Description

      When reading a QByteArray from QDataStream, the data stream first reads 4 bytes indicating the byte array payload size. It then attempts to allocate memory with the given size. In the case of reading from corrupted data, it may throw a std::bad_alloc exception due to an invalid size being read. It is better to limit the maximum allocation size and discard the allocations greater than defined maximum.

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            a.mosawi ali mosawi
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews