[ODBC-359] Segmentation fault in SQLFetch Created: 2022-05-06 Updated: 2022-06-20 Resolved: 2022-05-12 |
|
| Status: | Closed |
| Project: | MariaDB Connector/ODBC |
| Component/s: | General |
| Affects Version/s: | 3.1.15 |
| Fix Version/s: | 3.1.16 |
| Type: | Bug | Priority: | Major |
| Reporter: | Patrick Braun | Assignee: | Lawrin Novitsky |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Environment: |
Debian 11 amd64 and arm64 |
||
| Attachments: |
|
| Description |
|
SQLFetch crashes when target buffer was set to a null buffer to get column data length as SQL_C_WCHAR Crash occurres in ma_statement.c on line 1914 when
gets dereferenced and buffer is a null pointer. Attached are a test that currently crashes and a patch file that adds a NULL check |
| Comments |
| Comment by Lawrin Novitsky [ 2022-05-08 ] |
|
Thank you for your report. Everything looks to make sense. |
| Comment by Patrick Braun [ 2022-05-09 ] |
|
I have opened a PR on Github https://github.com/mariadb-corporation/mariadb-connector-odbc/pull/56 |
| Comment by Lawrin Novitsky [ 2022-05-12 ] |
|
The PR with the fix and the testcase has been merged. Thanks to Patrick Braun who did all the job |
| Comment by Lawrin Novitsky [ 2022-06-20 ] |
|
Updated description as column type was not important here, while SQL_C_WCHAR C type is |