[Home]

Summary:ASTERISK-28497: func_odbc: truncating Unicode string on readsql
Reporter:Boris P. Korzun (drtr0jan)Labels:
Date Opened:2019-08-07 00:36:29Date Closed:2020-01-02 09:35:03.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Functions/func_odbc
Versions:16.4.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:FreeBSD 11.2, Asterisk 16.4.0, unixODBC-2.3.7, MS SQL 2012Attachments:( 0) patch-funcs_func__odbc.c
Description:There's a table at MSSQL with NVARCHAR column.
I've created a function to retrieve info from the column. But I've a faced the function returned a truncated data (if STRLEN of data more than 8 unicode characters).

Example:
||MSSQL||Asterisk CLI||
|АБВГ|АБВГ|
|АБВГДЕЖЗИК|АБВГДЕЖЗИ|

I've founded the {{ast_odbc_ast_str_SQLGetData()}} returns the multibyte data to the buffer which length is less than needed (received by {{SQLDescribeCol()}}.

I suggest the patch where {{ast_odbc_ast_str_SQLGetData()}} considers column type for correct allocating the buffer.
Comments:By: Asterisk Team (asteriskteam) 2019-08-07 00:36:30.342-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Joshua C. Colp (jcolp) 2019-08-07 04:28:45.262-0500

In order to attach patches the contributor license agreement must be signed. Do you plan on signing it? If so after doing so you will need to reattach your change.

By: Boris P. Korzun (drtr0jan) 2019-08-07 04:37:56.955-0500

[~jcolp], I've signed it. But it must be approved by somebody. I will reattach the patch after approving of signature.

By: Joshua C. Colp (jcolp) 2019-08-07 04:45:07.106-0500

Assigning while waiting for license agreement to be handled.

By: Boris P. Korzun (drtr0jan) 2019-08-13 16:41:46.777-0500

The license has been formally accepted. And I've attached the fix for the bug.

By: Joshua C. Colp (jcolp) 2019-08-22 08:06:26.374-0500

Do you plan on putting this up for code review now that your license agreement is signed?

By: Boris P. Korzun (drtr0jan) 2019-08-28 05:34:09.138-0500

[~jcolp], I've put the patch for code review on Gerrit.

By: Friendly Automation (friendly-automation) 2020-01-02 09:35:04.346-0600

Change 13532 merged by Friendly Automation:
func_odbc:  acf_odbc_read() and cli_odbc_read() unicode support

[https://gerrit.asterisk.org/c/asterisk/+/13532|https://gerrit.asterisk.org/c/asterisk/+/13532]

By: Friendly Automation (friendly-automation) 2020-01-02 09:36:22.902-0600

Change 12812 merged by Joshua Colp:
func_odbc:  acf_odbc_read() and cli_odbc_read() unicode support

[https://gerrit.asterisk.org/c/asterisk/+/12812|https://gerrit.asterisk.org/c/asterisk/+/12812]

By: Friendly Automation (friendly-automation) 2020-01-02 09:40:51.100-0600

Change 13531 merged by Friendly Automation:
func_odbc:  acf_odbc_read() and cli_odbc_read() unicode support

[https://gerrit.asterisk.org/c/asterisk/+/13531|https://gerrit.asterisk.org/c/asterisk/+/13531]

By: Friendly Automation (friendly-automation) 2020-01-02 09:41:04.302-0600

Change 13530 merged by Friendly Automation:
func_odbc:  acf_odbc_read() and cli_odbc_read() unicode support

[https://gerrit.asterisk.org/c/asterisk/+/13530|https://gerrit.asterisk.org/c/asterisk/+/13530]