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

qUncompress may return a QByteArray that is not 0-terminated on Mac OS X

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • 4.6.2
    • 4.6.0
    • Core: I/O
    • None
    • macOS
    • 694be5a31be7e24761753ab9eccd87e8d08607e0

    Description

      In Qt 4.6.0, the QByteArray returned by qUncompress is not necessarily 0-terminated on Mac OS X.

      #include <QtCore>
      
      int main(int argc, char* argv[])
      {
      	QCoreApplication app(argc, argv);
      	QByteArray input("TestString");
      	/*qDebug() << "Input termination " << (int)*(input.data() + input.size());
      	QByteArray output = qUncompress(qCompress(input));
      	qDebug() << "Output termination" << (int)*(output.data() + output.size());*/
      
      	QByteArray output = qCompress(input);
      	qDebug() << qstrlen(output.data()) << output.size();
      	output = qUncompress(output);
      	qDebug() << qstrlen(output.data()) << output.size();
      }
      

      This is a regression from Qt 4.5.3 and broke with the change e2411ebd04bf9a55e6e3b24cc7886e597521d473

      Attachments

        Issue Links

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

          Activity

            People

              mgoetz Markus Goetz (Inactive)
              sanonymous Nokia Qt Support (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes