QSQL/ODBC: fix regression (trailing NUL)
authorDebian Qt/KDE Maintainers <debian-qt-kde@lists.debian.org>
Sun, 3 Mar 2024 09:03:16 +0000 (09:03 +0000)
committerSteve Langasek <vorlon@debian.org>
Sun, 3 Mar 2024 09:03:16 +0000 (09:03 +0000)
commit63d2c2436f438b6cdeec9c0fa9e39bb37c6e334b
treefa5748480a490a0aee611d2808cfa0340795ecff
parent0c0cc5ff4917def3d5b62be779026a11e9b40cc1
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