[ODBC-253] MADB_StmtExecDirect() crashes if StatementText is "\0" Created: 2019-06-03  Updated: 2019-06-06  Resolved: 2019-06-06

Status: Closed
Project: MariaDB Connector/ODBC
Component/s: General
Affects Version/s: 3.1.1
Fix Version/s: 3.1.2

Type: Bug Priority: Major
Reporter: Thorsten Hojnacki Assignee: Lawrin Novitsky
Resolution: Fixed Votes: 0
Labels: crash
Environment:

Maria DB 10.3.14/64 Bit
Maria ODBC Driver 3.1.1/x86
Windows 10/64 Bit
Microsoft Data Access SDK 2.8


Attachments: PNG File odbc-SqlExecDirect-null.png    

 Description   

If MADB_StmtExecDirect get called with a StatementText "\0" (only TN contained) an exception occures in "char* FixIsoFormat(char * StmtString, size_t *Length)".
This causes the client application to crash.

Steps to reproduce:
WCHAR * StatementText = L"\0";
RetCode = SQLExecDirect(hStmt, StatementText, SQL_NTS);

or

  1. Start odbct32w.exe from Microsoft Data Access SDK 2.8.
  2. Choose from menu: Conn...Full connect (choose any Maria DSN)
  3. Choose from menu: Stmt..SqlExecDirect
  4. Choose "statment text=<empty string>" and "statement length=SQL_NTS=-3 (3.0)"
  5. Press Ok
  6. odbct32w.exe crashes


This issue was originally observed when connecting via the Borland Database Engine (BDE).



 Comments   
Comment by Lawrin Novitsky [ 2019-06-06 ]

The fix has been pushed in commit 79fb9cb

Generated at Thu Feb 08 03:27:20 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.