Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.15.10, 6.2.5, 6.3.1, 6.4.0 Beta2
-
None
-
5
-
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)
-
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 |
424884,5 | qputenv: defend against non-NUL-terminated QByteArray values | dev | qt/qtbase | Status: MERGED | +2 | 0 |
424888,7 | qputenv: port to QByteArrayView | dev | qt/qtbase | Status: MERGED | +2 | 0 |
425319,4 | qputenv: defend against non-NUL-terminated QByteArray values | 6.4 | qt/qtbase | Status: MERGED | +2 | 0 |
425320,5 | qputenv: defend against non-NUL-terminated QByteArray values | 6.3 | qt/qtbase | Status: MERGED | +2 | 0 |
425329,3 | qputenv: defend against non-NUL-terminated QByteArray values | tqtc/lts-5.15 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |
425330,5 | qputenv: defend against non-NUL-terminated QByteArray values | tqtc/lts-6.2 | qt/tqtc-qtbase | Status: MERGED | +2 | 0 |