Prevent crashes from occurring when reading from data sources with large values

When reading configuration data from an Asterisk .conf file or when pulling
data from an Asterisk RealTime backend, Asterisk was copying the data on the
stack for manipulation. Unfortunately, it is possible to read configuration
data or realtime data from some data source that provides a large blob of
characters. This could potentially cause a crash via a stack overflow.

This patch prevents large sets of data from being read from an ARA backend or
from an Asterisk conf file.

(issue ASTERISK-20658)
Reported by: wdoekes
Tested by: wdoekes, mmichelson
patches:
 * issueA20658_dont_process_overlong_config_lines.patch uploaded by wdoekes (license 5674)
 * issueA20658_func_realtime_limit.patch uploaded by wdoekes (license 5674)
........

Merged revisions 378375 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 378376 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@378377 f38db490-d61c-443f-a65b-d21fe96a405b
Clean up app_mysql's application entry points to properly parse arguments

When parsing arguments, application entry points should not attempt to
directly modify the parameters to the function. This patch properly duplicates
the passed in parameters before attempting to parse them.

(issue ASTERISK-20658)
Reported by: wdoekes
patches:
  issueA20658_sanitize_app_mysql.patch uploaded by wdoekes (license 5674)


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@378384 f38db490-d61c-443f-a65b-d21fe96a405b