qt6-bb10/src/plugins
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
..
bearer Use lowercase name for iphlpapi library 2017-03-13 09:39:19 +00:00
generic Fix libs build with msvc on Chinese locale on Windows 2017-02-01 08:35:42 +00:00
imageformats Merge remote-tracking branch 'origin/5.7' into 5.8.0 2016-12-08 08:20:36 +01:00
platforminputcontexts Respect XDG_CONFIG_HOME when getting ibus socket location 2017-02-17 10:14:39 +00:00
platforms eglfs: fix x11 header related compile failure 2017-03-17 11:43:46 +00:00
platformthemes gtk3: Fix use of dangling pointers 2017-03-22 06:40:47 +00:00
printsupport Plugins: optimize string usage 2016-10-18 17:52:04 +00:00
sqldrivers PostgreSQL: fix datetime format when system locale doesn't use arabic numerals 2017-03-18 19:37:35 +00:00
plugins.pro Don't build SQL driver plugins if we are not building Qt SQL 2017-01-10 16:14:38 +00:00