mirror of
https://github.com/signalwire/freeswitch.git
synced 2026-11-14 13:28:31 +00:00
use "%s" format specifier for uses of switch_event_add_header that just pass a string to avoid potential issues/exploits"
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@4226 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
1 parent
f08d0e89c1
commit
07d6f12018
11 files changed
+80
-80
No files matched your search
+9
-9
@@ -439,7 +439,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_subclass(switch_event_t **ev
|
||||
|
||||
if (subclass_name) {
|
||||
(*event)->subclass = switch_core_hash_find(CUSTOM_HASH, subclass_name);
|
||||
switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Event-Subclass", subclass_name);
|
||||
switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Event-Subclass", "%s", subclass_name);
|
||||
}
|
||||
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
@@ -448,7 +448,7 @@ SWITCH_DECLARE(switch_status_t) switch_event_create_subclass(switch_event_t **ev
|
||||
SWITCH_DECLARE(switch_status_t) switch_event_set_priority(switch_event_t *event, switch_priority_t priority)
|
||||
{
|
||||
event->priority = priority;
|
||||
switch_event_add_header(event, SWITCH_STACK_TOP, "priority", switch_priority_name(priority));
|
||||
switch_event_add_header(event, SWITCH_STACK_TOP, "priority", "%s", switch_priority_name(priority));
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -812,18 +812,18 @@ SWITCH_DECLARE(switch_status_t) switch_event_fire_detailed(char *file, char *fun
|
||||
|
||||
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Calling-Line-Number", "%d", line);
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Calling-Function", func);
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Calling-File", switch_cut_path(file));
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Calling-Function", "%s", func);
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Calling-File", "%s", switch_cut_path(file));
|
||||
switch_time_exp_lt(&tm, switch_time_now());
|
||||
switch_strftime(date, &retsize, sizeof(date), "%Y-%m-%d %T", &tm);
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Date-Local", date);
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Date-Local", "%s", date);
|
||||
switch_rfc822_date(date, switch_time_now());
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Date-GMT", date);
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Date-GMT", "%s", date);
|
||||
if ((*event)->subclass) {
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Subclass", (*event)->subclass->name);
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Subclass-Owner", (*event)->subclass->owner);
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Subclass", "%s", (*event)->subclass->name);
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Subclass-Owner", "%s", (*event)->subclass->owner);
|
||||
}
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Name", switch_event_name((*event)->event_id));
|
||||
switch_event_add_header(*event, SWITCH_STACK_TOP, "Event-Name", "%s", switch_event_name((*event)->event_id));
|
||||
|
||||
|
||||
if (user_data) {
|
||||
|
||||
Reference in new issue
Block a user