QSQL/ODBC: fix regression (trailing NUL)
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Thu, 25 Jul 2024 12:43:37 +0000 (15:43 +0300)
committerDmitry Shachnev <mitya57@debian.org>
Thu, 25 Jul 2024 12:43:37 +0000 (15:43 +0300)
commit38ca5540c4a39200f3b9b48324cb7b7eeab348b9
treef048df3f03309127156b3aecd4e8a005ff1f29c9
parentca8ce2a32ffa9c6df13272e6867f0d12243feaaf
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