Audit ast_json_pack() calls for needed UTF-8 checks.

Added needed UTF-8 checks before constructing json objects in various
files for strings obtained outside the system.  In this case string values
from a channel driver's peer and not from the user setting channel
variables.

* aoc.c: Fixed type mismatch in s_to_json() for time and granularity json
object construction.

ASTERISK-26466
Reported by: Richard Mudgett

Change-Id: Iac2d867fa598daba5c5dbc619b5464625a7f2096
This commit is contained in:
Richard Mudgett
2016-10-12 16:24:14 -05:00
parent 7f8f125738
commit 3c54328c57
6 changed files with 31 additions and 30 deletions

View File

@@ -456,7 +456,7 @@ static struct ast_json *channel_dialplan(
"type", "ChannelDialplan",
"timestamp", ast_json_timeval(*tv, NULL),
"dialplan_app", new_snapshot->appl,
"dialplan_app_data", new_snapshot->data,
"dialplan_app_data", AST_JSON_UTF8_VALIDATE(new_snapshot->data),
"channel", json_channel);
}