From 54781bc36ad3a61ee6c2b8eb2ea19b8fa403ff85 Mon Sep 17 00:00:00 2001 From: Gaurav Sharma Date: Thu, 9 Oct 2025 10:58:56 +0530 Subject: [PATCH 1/2] FIX: Access Token Issue --- mssql_python/pybind/connection/connection.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mssql_python/pybind/connection/connection.cpp b/mssql_python/pybind/connection/connection.cpp index 3311c697..dfe34173 100644 --- a/mssql_python/pybind/connection/connection.cpp +++ b/mssql_python/pybind/connection/connection.cpp @@ -173,7 +173,7 @@ SQLRETURN Connection::setAttribute(SQLINTEGER attribute, py::object value) { LOG("Setting SQL attribute"); SQLPOINTER ptr = nullptr; SQLINTEGER length = 0; - std::string buffer; // to hold sensitive data temporarily + static std::string buffer; // to hold sensitive data temporarily if (py::isinstance(value)) { int intValue = value.cast(); From 55371969a294307a102d91c2faf509a840a837c3 Mon Sep 17 00:00:00 2001 From: Gaurav Sharma Date: Tue, 14 Oct 2025 17:22:40 +0530 Subject: [PATCH 2/2] remove std::fill block --- mssql_python/pybind/connection/connection.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/mssql_python/pybind/connection/connection.cpp b/mssql_python/pybind/connection/connection.cpp index dfe34173..03178c4f 100644 --- a/mssql_python/pybind/connection/connection.cpp +++ b/mssql_python/pybind/connection/connection.cpp @@ -196,10 +196,6 @@ SQLRETURN Connection::setAttribute(SQLINTEGER attribute, py::object value) { LOG("Set attribute successfully"); } - // Zero out sensitive data if used - if (!buffer.empty()) { - std::fill(buffer.begin(), buffer.end(), static_cast(0)); - } return ret; } @@ -383,4 +379,4 @@ py::object ConnectionHandle::getInfo(SQLUSMALLINT infoType) const { ThrowStdException("Connection object is not initialized"); } return _conn->getInfo(infoType); -} \ No newline at end of file +}