[asterisk-bugs] [JIRA] (ASTERISK-29614) app_agent_pool: XML Doc: unterminated entity reference

Alexander Traud (JIRA) noreply at issues.asterisk.org
Thu Sep 2 02:09:34 CDT 2021


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

Alexander Traud commented on ASTERISK-29614:
--------------------------------------------

bq. I don't know what the "wrong type of data in that XML string" means?

A node in XML can be anything. However, without special treatments (CDATA, special character escaping), it is text which is not allowed to violate the text encoding used as well (in our case UTF-8, I think). Therefore, a lot of restrictions apply to the final XML text. So this was a bug because converting a C string structure into a XML text node was not done. However, what confused me, the result had to be a Regular Expression *look-a-like* text to the user.

bq. The code was trying to write a const char ** as a string into the category node.

Then, I got it now. And the content is nothing but a look-a-like Regular Expression, displayed to the user but not used/executed by XML or something else.

bq. help output uses =~ and !~ which are typically used to indicate regular expression matching

Working with Regular Expressions (and matching) for 19 years now. Never seen that before. Learning never ends.

bq. Different module authors chose different names.

My Software Usability Engineer would give me a kick in the ass … never name things different if they do not differ. It is a pity that this passed code-inclusion-process. Furthermore, the console help does not cope with all the alternatives but requires knowledge about the one for that particular module. That made analysis of this issue even more confusing to me, why is this global, generic, globals, or general … what is the reason behind that … ahh, there is no reason. Glad, I posted this issue early. Would have taken me days to understand it.

> app_agent_pool: XML Doc: unterminated entity reference
> ------------------------------------------------------
>
>                 Key: ASTERISK-29614
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29614
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Applications/app_agent_pool, Applications/app_skel, Documentation
>    Affects Versions: 13.38.3, 16.20.0, 18.6.0, 19.0.0
>         Environment: Ubuntu 18.04 LTS
> ./configure --enable-xmldoc, which is the default
> make all or make full, does not matter
>            Reporter: Alexander Traud
>            Assignee: Sean Bright
>            Severity: Major
>
> This issue seems not to be of constant occurrence. Furthermore, I was not able to find any reports about this except several failed builds in Gerrit. Perhaps those are related but I did not investigated those further, yet. 
> Currently, I am able to replicate it quite constant and was able to investigate a bit with GDB. However, I am reporting early in my analysis, perhaps somebody sees the culprit faster.
> *My symptom*:
> {code} Loading app_agent_pool.so.
>   == Manager registered action Agents
>   == Manager registered action AgentLogoff
>   == Registered custom function 'AGENT'
>   == Registered application 'AgentLogin'
>   == Registered application 'AgentRequest'
> error : unterminated entity reference            ���
>   == app_agent_pool.so => (Call center agent pool applications){code}*My call stack*:
> apps/app_agent_pool.c
> ⤷ load_module
>    ⤷ load_config
>       ⤷ aco_info_init
>          ⤷ type = agent_type (the second type from {{app_agent_pool}}, the one after the {{general_type}})
>             ⤷ xmldoc_update_config_type in file main/xml.c
>                ⤷ ast_xml_set_text
>                   ⤷ xmlNodeSetContent
> That error is not printed, when I remove _all_ categories except the terminating NULL, in the file {{apps/app_agent_pool.c}}, in the string array {{agent_type_blacklist}}. That error is not printed, when I comment/disable at least four of the eight {{aco_option_register}} in {{load_config}}.
> This looks like a memory corruption, because even when that error is not printed, on the command-line interface (CLI), I am not able to issue {{xmldoc dump <file>}} when the module {{app_agent_pool}} is loaded. I get errors like {{output error : string is not in UTF-8}} or {{xmlEscapeEntities : char out of range}}.
> *Workarounds*:
> a) {{./configure --disable-xmldoc}} or
> b) disable the module {{app_agent_pool}} via {{make menuselect}} or
> c) noload the module {{app_agent_pool}} via the configuration file {{modules.conf}} or
> d) change the string array {{agent_type_blacklist}} to contain just the terminating {{NULL}} value



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



More information about the asterisk-bugs mailing list