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

Boris P. Korzun (JIRA) noreply at issues.asterisk.org
Tue Aug 13 16:40:47 CDT 2019


     [ https://issues.asterisk.org/jira/browse/ASTERISK-28497?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

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

    Comment: was deleted

(was: The patch for bug fix.)

> 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
>            Assignee: Unassigned
>            Severity: Minor
>         Attachments: patch-funcs_func__odbc.c, patch-funcs_func__odbc.c
>
>
> 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