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

qputenv sometimes puts garbage at the end of the value

    XMLWordPrintable

    Details

    • Story Points:
      5
    • Commits:
      15422d191f (qt/qtbase/dev) 15422d191f (qt/tqtc-qtbase/dev) b81f6d838a (qt/tqtc-qtbase/6.2) 3e8530d701 (qt/qtbase/6.4) 51577e8599 (qt/qtbase/6.3) f4e1c43872 (qt/tqtc-qtbase/5.15) 51577e8599 (qt/tqtc-qtbase/6.3) 3e8530d701 (qt/tqtc-qtbase/6.4)
    • Sprint:
      Foundation Sprint 62, Foundation Sprint 63

      Description

      Sometimes, qputenv puts extra characters at the end of the value, as in

      void check(const QByteArray &value) {
         qDebug() << value; // prints expected value
         qputenv("MEEP", value);
         qDebug() << qgetenv("MEEP"); // prints expected value, and then some
      }
      

      I've ran it under valgrind, and it complains that qputenv is reading past the end of the buffer (we're using a stack buffer and QByteArray::fromRawData() to avoid the memory allocation).

        Attachments

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

          Activity

            People

            Assignee:
            mmutz Marc Mutz
            Reporter:
            mmutz Marc Mutz
            PM Owner:
            Vladimir Minenko Vladimir Minenko
            RnD Owner:
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: