mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
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:
@@ -1415,11 +1415,13 @@ static int report_fax_status(struct ast_channel *chan, struct ast_fax_session_de
|
||||
}
|
||||
|
||||
json_object = ast_json_pack("{s: s, s: s, s: s, s: s, s: o}",
|
||||
"type", "status",
|
||||
"operation", (details->caps & AST_FAX_TECH_GATEWAY) ? "gateway" : (details->caps & AST_FAX_TECH_RECEIVE) ? "receive" : "send",
|
||||
"status", status,
|
||||
"local_station_id", details->localstationid,
|
||||
"filenames", json_filenames);
|
||||
"type", "status",
|
||||
"operation", (details->caps & AST_FAX_TECH_GATEWAY)
|
||||
? "gateway"
|
||||
: (details->caps & AST_FAX_TECH_RECEIVE) ? "receive" : "send",
|
||||
"status", status,
|
||||
"local_station_id", AST_JSON_UTF8_VALIDATE(details->localstationid),
|
||||
"filenames", json_filenames);
|
||||
if (!json_object) {
|
||||
return -1;
|
||||
}
|
||||
|
Reference in New Issue
Block a user