From bae157261b0654d5043362dbe43ca97a27c59248 Mon Sep 17 00:00:00 2001 From: Christian Ehrlicher Date: Tue, 20 May 2025 20:32:38 +0200 Subject: [PATCH] SQL/ODBC: fix escaping the username/password The escaping for '{' was wrong in the previous commit. Amends 38277a88f1dd69de6e031bc8313c8d5beadf6bd0 Pick-to: 6.8 Task-number: QTBUG-122642 Change-Id: Ia363c76b27e527114769b4a923418cddad5586f1 Reviewed-by: Axel Spoerl (cherry picked from commit d2cd406b349a7c58c3af953c9c7dbf47137c0c73) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit deda96666d0ebf4b4b903a37555fbb70edc55e52) --- src/plugins/sqldrivers/odbc/qsql_odbc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp index f2f2619404c..e09e65f223a 100644 --- a/src/plugins/sqldrivers/odbc/qsql_odbc.cpp +++ b/src/plugins/sqldrivers/odbc/qsql_odbc.cpp @@ -1963,7 +1963,7 @@ bool QODBCDriver::open(const QString & db, connQStr = "DSN="_L1 + db; const auto escapeUserPassword = [](QString arg) -> QString { - return u'{' + arg.replace(u'}', u'{') + u'}'; + return u'{' + arg.replace(u'}', "}}"_L1) + u'}'; }; if (!user.isEmpty()) connQStr += ";UID="_L1 + escapeUserPassword(user);