Skip to content

QSQL/ODBC: fix regression (trailing NUL)

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.

Amends 4c445ef0 and 46af1fe4.

Done-with: Christian Ehrlicher ch.ehrlicher@gmx.de Pick-to: 6.5 6.5.0 6.4 6.2 5.15 Change-Id: I6210b77e9417f46294df94cb32ab4134af8dc4c2 Reviewed-by: Andy Shaw andy.shaw@qt.io (cherry picked from commit 9020034b)

Merge request reports