[asterisk-bugs] [JIRA] (ASTERISK-25272) The ICONV dialplan function somtetimes returns garbage

Asterisk Team (JIRA) noreply at issues.asterisk.org
Wed Jul 22 06:56:33 CDT 2015


    [ https://issues.asterisk.org/jira/browse/ASTERISK-25272?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=226996#comment-226996 ] 

Asterisk Team commented on ASTERISK-25272:
------------------------------------------

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].

> The ICONV dialplan function somtetimes returns garbage
> ------------------------------------------------------
>
>                 Key: ASTERISK-25272
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25272
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Functions/func_iconv
>    Affects Versions: 11.18.0, 13.4.0
>         Environment: Debian wheezy i686
>            Reporter: Etienne Lessard
>         Attachments: AST-25272.patch
>
>
> Given I have the following extension:
> {noformat}
> exten = 12,1,NoOp()
> same  =   n,Set(MSG=abcdefghijklmnopqrstuvwxyz)
> same  =   n,NoOp(${ICONV(ASCII,ASCII,${MSG})})
> same  =   n,Set(MSG=hello)
> same  =   n,NoOp(${ICONV(ASCII,ASCII,${MSG})})
> same  =   n,Hangup()
> {noformat}
> When I call this extension
> Then I see in the Asterisk CLI:
> {noformat}
> -- Executing [12 at default:1] NoOp("SIP/gl0ezv-00000005", "") in new stack
> -- Executing [12 at default:2] Set("SIP/gl0ezv-00000005", "MSG=abcdefghijklmnopqrstuvwxyz") in new stack
> -- Executing [12 at default:3] NoOp("SIP/gl0ezv-00000005", "abcdefghijklmnopqrstuvwxyz") in new stack
> -- Executing [12 at default:4] Set("SIP/gl0ezv-00000005", "MSG=hello") in new stack
> -- Executing [12 at default:5] NoOp("SIP/gl0ezv-00000005", "hellofghijklmnopqrstuvwxyz") in new stack
> {noformat}
> Expected: the second call to ICONV (at priority 5) returns "hello" instead of
> "hellofghijklmnopqrstuvwxyz".
> There's other way to trigger the bug, but this dialplan is the easiest way I have found.
> I've taken a look at func_iconv.c, and we can see that a null character is not appended at the end of the output string, and since the output string is not previously filled with null character, this bugs shows up.
> I've attached a patch that I tested against the following scenarios:
> * original test described in this issue
> * converting "Valérie" from UTF-8 to ASCII//IGNORE
> * converting "Valérie" from UTF-8 to ASCII
> Thank you.



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



More information about the asterisk-bugs mailing list