qt6-bb10/src
Thiago Macieira 524f39db89 gtk3: Fix use of dangling pointers
QString::toUtf8() returns QByteArray, which got implicitly converted to
C strings and promptly deleted. Instead, return the QByteArray to the
caller.

Found by ASAN:
==13935==ERROR: AddressSanitizer: heap-use-after-free on address 0x6060000dffb8 at pc 0x7f764f27320b bp 0x7ffd49b11bb0 sp 0x7ffd49b11358
READ of size 7 at 0x6060000dffb8 thread T0
    #1 0x7f7649d174e2 in g_strdup (/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x684e2)
    #2 0x7f763f7abe5b  (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x39e5b)
    #3 0x7f763f78915a in g_object_new_valist (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x1715a)
    #4 0x7f763f789520 in g_object_new (/usr/lib/x86_64-linux-gnu/libgobject-2.0.so.0+0x17520)
    #5 0x7f7640f6bcb0 in gtk_dialog_add_button (/usr/lib/x86_64-linux-gnu/libgtk-3.so.0+0x186cb0)
    #6 0x7f7640f8d2c9 in gtk_file_chooser_dialog_new (/usr/lib/x86_64-linux-gnu/libgtk-3.so.0+0x1a82c9)
    #7 0x7f7641727281  (/opt/Qt5.8.0/5.8/gcc_64/plugins/platformthemes/libqgtk3.so+0x13281)

Task-number: QTBUG-59611
Change-Id: I37cc967e689f4523b504fffd14adbf944b53b754
Reviewed-by: J-P Nurmi <jpnurmi@qt.io>
2017-03-22 06:40:47 +00:00
..
3rdparty forkfd: fix calling the old signal handler when there wasn't one 2017-03-06 09:56:35 +00:00
android Android: Fix always hidden software keyboard from popping up 2017-02-23 08:16:23 +00:00
angle Fix unneeded recompiles of glslang_tab.cpp 2017-01-16 15:20:27 +00:00
concurrent Adapt to the C++ SIC introduced by P0012: noexcept overloading 2017-02-17 13:57:30 +00:00
corelib QMetaType & QVariant: "load" and "save" std::nullptr_t 2017-03-20 21:53:32 +00:00
dbus Use QT_CONFIG(library) instead of QT_NO_LIBRARY 2017-03-06 11:27:20 +00:00
gui Fix crash in QWindowPrivate::applyCursor when screen is null 2017-03-16 18:03:24 +00:00
network Android: Bearer jar shouldn't be a dependency if disabled 2017-03-17 19:25:43 +00:00
opengl Use QT_CONFIG(library) instead of QT_NO_LIBRARY 2017-03-06 11:27:20 +00:00
openglextensions Also release winmain, qopenglextensions under commercial licenses 2016-11-18 16:19:56 +00:00
platformheaders Doc: corrected qdoc syntax parameter description 2017-01-09 15:30:17 +00:00
platformsupport Enable QStyleHints::useHoverEffects for KDE and other unix systems 2017-03-07 15:22:17 +00:00
plugins gtk3: Fix use of dangling pointers 2017-03-22 06:40:47 +00:00
printsupport Android: Enable the usage of QPrinter 2017-03-09 11:04:03 +00:00
sql Fix "zero as null pointer constant" warning 2017-02-28 15:04:47 +00:00
testlib Use the same timeout value for all QTest::qWaitForWindow*() functions 2017-03-08 07:19:45 +00:00
tools qlalr: Use forward slashes in #include directives 2017-03-10 08:47:19 +00:00
widgets QToolBox: fix potential UB (invalid cast) in Private::_q_widgetDestroyed() 2017-03-21 14:30:31 +00:00
winmain QtCore & winmain: Remove dead code 2017-01-31 19:09:31 +00:00
xml QXmlAttributes: mark as shared-come-qt6 2016-10-04 06:25:54 +00:00
src.pro Add a feature for Qt Xml 2017-01-06 17:19:13 +00:00