Ivan Daschinsky created IGNITE-16279:
----------------------------------------
Summary: CPP: ODBC String without with fixed length is treated as
SQL_NTS, causes heap buffer overflow
Key: IGNITE-16279
URL: https://issues.apache.org/jira/browse/IGNITE-16279
Project: Ignite
Issue Type: Bug
Reporter: Ivan Daschinsky
{code}
Index: modules/platforms/cpp/odbc/src/utility.cpp
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/modules/platforms/cpp/odbc/src/utility.cpp
b/modules/platforms/cpp/odbc/src/utility.cpp
--- a/modules/platforms/cpp/odbc/src/utility.cpp (revision
e18bbbedfa23f4a4c7bcd1f4c48fa881411e5653)
+++ b/modules/platforms/cpp/odbc/src/utility.cpp (date 1641994995236)
@@ -136,8 +136,10 @@
if (!sqlStr || !sqlStrLen)
return res;
- if (sqlStrLen == SQL_NTS)
+ if (sqlStrLen == SQL_NTS) {
+ std::cout << "Hopla " << sqlStrC << std::endl;
res.assign(sqlStrC);
+ }
else if (sqlStrLen > 0)
res.assign(sqlStrC, sqlStrLen);
{code}
Run {{TestStingParamNullLen}} under ASan and get report:
--
This message was sent by Atlassian Jira
(v8.20.1#820001)