[asterisk-bugs] [JIRA] (ASTERISK-28497) func_odbc: truncating Unicode string on readsql

Boris P. Korzun (JIRA) noreply at issues.asterisk.org
Wed Aug 7 00:36:47 CDT 2019


Boris P. Korzun created ASTERISK-28497:
------------------------------------------

             Summary: func_odbc: truncating Unicode string on readsql
                 Key: ASTERISK-28497
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-28497
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Functions/func_odbc
    Affects Versions: 16.4.0
         Environment: FreeBSD 11.2, Asterisk 16.4.0, unixODBC-2.3.7, MS SQL 2012
            Reporter: Boris P. Korzun


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.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list