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

QDataStream cannot serialize containers > 2Gi elements

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P2: Important P2: Important
    • None
    • 6.2.4, 6.3.1, 6.4.0 Beta2
    • Core: Serialization
    • None
    • 13
    • Foundation PM Prioritized

      The code fails on 64-bit platforms:

      QByteArray ba;
      const QString str =  ~~~ more than 2Gi characters ~~~;
      QDataStream(&ba) << str;
      QString restored;
      QDataStream(ba) >> restored;
      assert(restored == str);
      

      Ditto all other containers.

      The problem seems to be that the serialisation format only allocates a four-octet length field.

      There doesn't appear to be something you can do, unless you change the format to include a longer length indicator.

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

            cnn Qt Core & Network
            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