QSQL/ODBC: fix regression (trailing NUL)
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 27 Mar 2025 11:24:29 +0000 (14:24 +0300)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 27 Mar 2025 11:24:29 +0000 (14:24 +0300)
commitdea6e3ee038b865a4ba05dc830549259fa2f46b7
treeecfdbe28a5fd4e9ba495e442f259c0cb934de03d
parent3f97bdf18bf17721e0b4ef4a0de90e8daaafc99c
QSQL/ODBC: fix regression (trailing NUL)

Origin: upstream, https://code.qt.io/cgit/qt/qtbase.git/commit/?id=9020034b3b6a3a81
Last-Update: 2023-06-30

When we fixed the callers of toSQLTCHAR() to use the result's size()
instead of the input's (which differ, if sizeof(SQLTCHAR) != 2), we
exposed callers to the append(0), which changes the size() of the
result QVLA. Callers that don't rely on NUL-termination (all?) now saw
an additional training NUL.

Fix by not NUL-terminating, and changing the only user of SQL_NTS to
use an explicit length.

Gbp-Pq: Name sql_odbc_fix_unicode_check.diff
src/plugins/sqldrivers/odbc/qsql_odbc.cpp