[Freeswitch-svn] [commit] r4226 - in freeswitch/trunk/src: . mod/applications/mod_conference mod/endpoints/mod_sofia mod/event_handlers/mod_event_multicast mod/event_handlers/mod_event_socket mod/languages/mod_spidermonkey mod/xml_int/mod_xml_rpc

Freeswitch SVN mikej at freeswitch.org
Mon Feb 12 23:43:49 EST 2007


Author: mikej
Date: Mon Feb 12 23:43:49 2007
New Revision: 4226

Modified:
   freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
   freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
   freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
   freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
   freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
   freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
   freeswitch/trunk/src/switch_channel.c
   freeswitch/trunk/src/switch_core.c
   freeswitch/trunk/src/switch_event.c
   freeswitch/trunk/src/switch_ivr.c
   freeswitch/trunk/src/switch_loadable_module.c

Log:
use "%s" format specifier for uses of switch_event_add_header that just pass a string to avoid potential issues/exploits"

Modified: freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_conference/mod_conference.c	Mon Feb 12 23:43:49 2007
@@ -528,7 +528,7 @@
             switch_channel_t *channel = switch_core_session_get_channel(member->session);
             switch_channel_event_set_data(channel, event);
 
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "add-member");
             switch_event_fire(&event);
@@ -625,7 +625,7 @@
             switch_channel_t *channel = switch_core_session_get_channel(member->session);
             switch_channel_event_set_data(channel, event);
 
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "del-member");
             switch_event_fire(&event);
@@ -975,7 +975,7 @@
 			switch_channel_t *channel = switch_core_session_get_channel(member->session);
 
 			switch_channel_event_set_data(channel, event);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "energy-level");
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->energy_level);
@@ -1001,7 +1001,7 @@
 			switch_channel_t *channel = switch_core_session_get_channel(member->session);
 
 			switch_channel_event_set_data(channel, event);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "energy-level");
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->energy_level);
@@ -1030,7 +1030,7 @@
 			switch_channel_t *channel = switch_core_session_get_channel(member->session);
 
 			switch_channel_event_set_data(channel, event);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "energy-level");
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->energy_level);
@@ -1057,7 +1057,7 @@
 			switch_channel_t *channel = switch_core_session_get_channel(member->session);
 
 			switch_channel_event_set_data(channel, event);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "volume-level");
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_out_level);
@@ -1083,7 +1083,7 @@
 			switch_channel_t *channel = switch_core_session_get_channel(member->session);
 
 			switch_channel_event_set_data(channel, event);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "volume-level");
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_out_level);
@@ -1110,7 +1110,7 @@
 			switch_channel_t *channel = switch_core_session_get_channel(member->session);
 
 			switch_channel_event_set_data(channel, event);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "volume-level");
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_out_level);
@@ -1137,7 +1137,7 @@
 			switch_channel_t *channel = switch_core_session_get_channel(member->session);
 
 			switch_channel_event_set_data(channel, event);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "gain-level");
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_in_level);
@@ -1163,7 +1163,7 @@
 			switch_channel_t *channel = switch_core_session_get_channel(member->session);
 
 			switch_channel_event_set_data(channel, event);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "gain-level");
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_in_level);
@@ -1190,7 +1190,7 @@
 			switch_channel_t *channel = switch_core_session_get_channel(member->session);
 
 			switch_channel_event_set_data(channel, event);
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "gain-level");
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Level", "%d", member->volume_in_level);
@@ -1327,7 +1327,7 @@
 						talking = 1;		
 						if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
 							switch_channel_event_set_data(channel, event);
-							switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+							switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 							switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 							switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "start-talking");
 							switch_event_fire(&event);
@@ -1346,7 +1346,7 @@
 
 						if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
 							switch_channel_event_set_data(channel, event);
-							switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+							switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
 							switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
 							switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "stop-talking");
 							switch_event_fire(&event);
@@ -2296,7 +2296,7 @@
             switch_channel_t *channel = switch_core_session_get_channel(member->session);
             switch_channel_event_set_data(channel, event);
 
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "mute-member");
             switch_event_fire(&event);
@@ -2331,7 +2331,7 @@
             switch_channel_t *channel = switch_core_session_get_channel(member->session);
             switch_channel_event_set_data(channel, event);
 
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "unmute-member");
             switch_event_fire(&event);
@@ -2358,7 +2358,7 @@
             switch_channel_t *channel = switch_core_session_get_channel(member->session);
             switch_channel_event_set_data(channel, event);
 
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "deaf-member");
             switch_event_fire(&event);
@@ -2385,7 +2385,7 @@
             switch_channel_t *channel = switch_core_session_get_channel(member->session);
             switch_channel_event_set_data(channel, event);
 
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "undeaf-member");
             switch_event_fire(&event);
@@ -2418,7 +2418,7 @@
             switch_channel_t *channel = switch_core_session_get_channel(member->session);
             switch_channel_event_set_data(channel, event);
 
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "kick-member");
             switch_event_fire(&event);
@@ -2461,7 +2461,7 @@
         switch_channel_t *channel = switch_core_session_get_channel(member->session);
         switch_channel_event_set_data(channel, event);
 
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
         switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
         switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "dtmf-member");
         switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Digits", dtmf);
@@ -2493,7 +2493,7 @@
                 switch_channel_t *channel = switch_core_session_get_channel(member->session);
                 switch_channel_event_set_data(channel, event);
 
-                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "energy-level-member");
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Energy-Level", "%d", member->energy_level);
@@ -2530,7 +2530,7 @@
                 switch_channel_t *channel = switch_core_session_get_channel(member->session);
                 switch_channel_event_set_data(channel, event);
 
-                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "volume-in-member");
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Volume-Level", "%u", member->volume_in_level);
@@ -2568,7 +2568,7 @@
                 switch_channel_t *channel = switch_core_session_get_channel(member->session);
                 switch_channel_event_set_data(channel, event);
 
-                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", member->conference->name);
+                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", member->conference->name);
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "volume-out-member");
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Volume-Level", "%u", member->volume_out_level);
@@ -2655,9 +2655,9 @@
         if (conference_play_file(conference, argv[2], 0, NULL) == SWITCH_STATUS_SUCCESS) {
             stream->write_function(stream, "(play) Playing file %s\n", argv[2]);
             if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
-                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
+                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "play-file");
-                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "File", argv[2]);
+                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "File", "%s", argv[2]);
                 switch_event_fire(&event);
             }
         } else {
@@ -2672,10 +2672,10 @@
             if (conference_member_play_file(member, argv[2], 0) == SWITCH_STATUS_SUCCESS) {
                 stream->write_function(stream, "(play) Playing file %s to member %u\n", argv[2], id);
                 if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
-                    switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
+                    switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
                     switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", id);
                     switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "play-file-member");
-                    switch_event_add_header(event, SWITCH_STACK_BOTTOM, "File", argv[2]);
+                    switch_event_add_header(event, SWITCH_STACK_BOTTOM, "File", "%s", argv[2]);
                     switch_event_fire(&event);
                 }
             } else {
@@ -2704,7 +2704,7 @@
 
         stream->write_function(stream, "(say) OK\n");
         if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "speak-text");
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Text", "%s", text);
             switch_event_fire(&event);
@@ -2764,7 +2764,7 @@
 
         stream->write_function(stream, "(saymember) OK\n");
         if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "speak-text-member");
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", id);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Text", "%s", text);
@@ -2900,7 +2900,7 @@
     switch_set_flag_locked(conference, CFLAG_LOCKED);
     stream->write_function(stream, "OK %s locked\n", argv[0]);
     if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
+        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
         switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "lock");
         switch_event_fire(&event);
     }
@@ -2922,7 +2922,7 @@
     switch_clear_flag_locked(conference, CFLAG_LOCKED);
     stream->write_function(stream, "OK %s unlocked\n", argv[0]);
     if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
-        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", conference->name);
+        switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", conference->name);
         switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "unlock");
         switch_event_fire(&event);
     }
@@ -3077,8 +3077,8 @@
             if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
                 switch_channel_event_set_data(channel, event);
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Member-ID", "%u", member->id);
-                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-Conference-Name", conference->name);
-                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Conference-Name", argv[3]);
+                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Old-Conference-Name", "%s", conference->name);
+                switch_event_add_header(event, SWITCH_STACK_BOTTOM, "New-Conference-Name", "%s", argv[3]);
                 switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "transfer");
                 switch_event_fire(&event);
             }
@@ -3490,9 +3490,9 @@
         conference_outcall(call->conference, call->session, call->bridgeto, call->timeout, call->flags, call->cid_name, call->cid_num, &cause);
 
         if (switch_event_create_subclass(&event, SWITCH_EVENT_CUSTOM, CONF_EVENT_MAINT) == SWITCH_STATUS_SUCCESS) {
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", call->conference->name);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Conference-Name", "%s", call->conference->name);
             switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Action", "bgdial-result");
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Result", switch_channel_cause2str(cause));
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Result", "%s", switch_channel_cause2str(cause));
             switch_event_fire(&event);
         }
         switch_safe_free(call->bridgeto);

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c	Mon Feb 12 23:43:49 2007
@@ -3420,7 +3420,7 @@
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s+%s@%s", SOFIA_CHAT_PROTO, from_user, from_host);
 		
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "unavailable");
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", rpid);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "rpid", "%s", rpid);
 			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "event_type", "presence");
 			switch_event_fire(&event);
 		}
@@ -3483,7 +3483,7 @@
 	}
 
 	if (switch_event_create(&event, SWITCH_EVENT_PRESENCE_IN) == SWITCH_STATUS_SUCCESS) {
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", proto ? proto : SOFIA_CHAT_PROTO);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "%s", proto ? proto : SOFIA_CHAT_PROTO);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", profile->url);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s@%s", user, host);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "status", "%s", status);

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c	Mon Feb 12 23:43:49 2007
@@ -163,7 +163,7 @@
 		case SWITCH_EVENT_LOG:
 			return;
 		default:
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Multicast-Sender", globals.hostname);
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Multicast-Sender", "%s", globals.hostname);
 			if (switch_event_serialize(event, &packet) == SWITCH_STATUS_SUCCESS) {
 				memcpy(buf, &globals.host_hash, sizeof(globals.host_hash));
 				switch_copy_string(buf + sizeof(globals.host_hash), packet, sizeof(buf) - sizeof(globals.host_hash));
@@ -310,7 +310,7 @@
 							}
 						}
 						snprintf(tmpname, sizeof(tmpname), "Orig-%s", var);
-						switch_event_add_header(local_event, SWITCH_STACK_BOTTOM, tmpname, val);
+						switch_event_add_header(local_event, SWITCH_STACK_BOTTOM, tmpname, "%s", val);
 						var = term + 1;
 					} else {
 						break;

Modified: freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c
==============================================================================
--- freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	(original)
+++ freeswitch/trunk/src/mod/event_handlers/mod_event_socket/mod_event_socket.c	Mon Feb 12 23:43:49 2007
@@ -409,7 +409,7 @@
 					count++;
 					if (count == 1) {
 						switch_event_create(event, SWITCH_EVENT_MESSAGE);
-						switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Command", mbuf);
+						switch_event_add_header(*event, SWITCH_STACK_BOTTOM, "Command", "%s", mbuf);
 					} else if (cur) {
 						char *var, *val;
 						var = cur;
@@ -422,7 +422,7 @@
 								}
 							} 
 							if (var && val) {
-								switch_event_add_header(*event, SWITCH_STACK_BOTTOM, var, val);
+								switch_event_add_header(*event, SWITCH_STACK_BOTTOM, var, "%s", val);
 							}
 						}
 					}
@@ -549,7 +549,7 @@
         switch_event_t *event;
         
         if (switch_event_create(&event, SWITCH_EVENT_BACKGROUND_JOB) == SWITCH_STATUS_SUCCESS) {
-            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Job-UUID", acs->uuid_str);
+            switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Job-UUID", "%s", acs->uuid_str);
             switch_event_add_body(event, reply);
             switch_event_fire(&event);
         }

Modified: freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c
==============================================================================
--- freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	(original)
+++ freeswitch/trunk/src/mod/languages/mod_spidermonkey/mod_spidermonkey.c	Mon Feb 12 23:43:49 2007
@@ -185,7 +185,7 @@
 	if (argc > 1) {
 		char *hname = JS_GetStringBytes(JS_ValueToString(cx, argv[0]));
 		char *hval = JS_GetStringBytes(JS_ValueToString(cx, argv[1]));
-		switch_event_add_header(eo->event, SWITCH_STACK_BOTTOM, hname, hval);
+		switch_event_add_header(eo->event, SWITCH_STACK_BOTTOM, hname, "%s", hval);
 		*rval = BOOLEAN_TO_JSVAL( JS_TRUE );
 		return JS_TRUE;
 	}

Modified: freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c
==============================================================================
--- freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	(original)
+++ freeswitch/trunk/src/mod/xml_int/mod_xml_rpc/mod_xml_rpc.c	Mon Feb 12 23:43:49 2007
@@ -171,14 +171,14 @@
 	}
 
 	if (switch_event_create(&stream.event, SWITCH_EVENT_API) == SWITCH_STATUS_SUCCESS) {
-		if (r->uri) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-URI", r->uri);
-		if (r->query) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-QUERY", r->query);
-		if (r->host) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-HOST", r->host);
-		if (r->from) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-FROM", r->from);
-		if (r->useragent) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-USER-AGENT", r->useragent);
-		if (r->referer) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-REFERER", r->referer);
-		if (r->requestline) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-REQUESTLINE", r->requestline);
-		if (r->user) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-USER", r->user);
+		if (r->uri) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-URI", "%s", r->uri);
+		if (r->query) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-QUERY", "%s", r->query);
+		if (r->host) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-HOST", "%s", r->host);
+		if (r->from) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-FROM", "%s", r->from);
+		if (r->useragent) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-USER-AGENT", "%s", r->useragent);
+		if (r->referer) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-REFERER", "%s", r->referer);
+		if (r->requestline) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-REQUESTLINE", "%s", r->requestline);
+		if (r->user) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-USER", "%s", r->user);
 		if (r->port) switch_event_add_header(stream.event, SWITCH_STACK_BOTTOM, "HTTP-PORT", "%u", r->port);
 	}
 

Modified: freeswitch/trunk/src/switch_channel.c
==============================================================================
--- freeswitch/trunk/src/switch_channel.c	(original)
+++ freeswitch/trunk/src/switch_channel.c	Mon Feb 12 23:43:49 2007
@@ -245,7 +245,7 @@
 
 	if (bytes && switch_event_create(&event, SWITCH_EVENT_DTMF) == SWITCH_STATUS_SUCCESS) {
 		switch_channel_event_set_data(channel, event);
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "DTMF-String", dtmf);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "DTMF-String", "%s", dtmf);
 		switch_event_fire(&event);
 	}
 
@@ -284,7 +284,7 @@
 	}
 
 	if (switch_event_create(&event, type) == SWITCH_STATUS_SUCCESS) {
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", __FILE__);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "proto", "%s", __FILE__);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "login", "%s", __FILE__);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "from", "%s", id);
 		if (type == SWITCH_EVENT_PRESENCE_IN) {
@@ -631,10 +631,10 @@
 				} else {
 					char state_num[25];
 					snprintf(state_num, sizeof(state_num), "%d", channel->state);
-					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State", (char *) switch_channel_state_name(channel->state));
-					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", (char *) state_num);
-					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Name", switch_channel_get_name(channel));
-					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(channel->session));
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State", "%s", (char *) switch_channel_state_name(channel->state));
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", "%s", (char *) state_num);
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Name", "%s", switch_channel_get_name(channel));
+					switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Unique-ID", "%s", switch_core_session_get_uuid(channel->session));
 				}
 				switch_event_fire(&event);
 			}
@@ -681,19 +681,19 @@
         originatee_caller_profile = caller_profile->originatee_caller_profile;
     }
 
-	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State", (char *) switch_channel_state_name(channel->state));
+	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State", "%s", (char *) switch_channel_state_name(channel->state));
 	snprintf(state_num, sizeof(state_num), "%d", channel->state);
-	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", (char *) state_num);
-	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Name", switch_channel_get_name(channel));
-	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Unique-ID", switch_core_session_get_uuid(channel->session));
+	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-State-Number", "%s", (char *) state_num);
+	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Name", "%s", switch_channel_get_name(channel));
+	switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Unique-ID", "%s", switch_core_session_get_uuid(channel->session));
 	
 	if ((codec = switch_core_session_get_read_codec(channel->session))) {
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Read-Codec-Name", codec->implementation->iananame);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Read-Codec-Name", "%s", codec->implementation->iananame);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Read-Codec-Rate", "%u", codec->implementation->samples_per_second);
 	}
 	
 	if ((codec = switch_core_session_get_write_codec(channel->session))) {
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Name", codec->implementation->iananame);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Name", "%s", codec->implementation->iananame);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Channel-Write-Codec-Rate", "%u", codec->implementation->samples_per_second);
 	}
 
@@ -718,7 +718,7 @@
 		char buf[1024];
 		switch_hash_this(hi, &var, NULL, &val);
 		snprintf(buf, sizeof(buf), "variable_%s", (char *) var);
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, buf, (char *) val);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, buf, "%s", (char *) val);
 	}
 
 
@@ -962,7 +962,7 @@
 						  channel->name,
 						  state_names[last_state], switch_channel_cause2str(channel->hangup_cause));
 		if (switch_event_create(&event, SWITCH_EVENT_CHANNEL_HANGUP) == SWITCH_STATUS_SUCCESS) {
-			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hangup-Cause", switch_channel_cause2str(channel->hangup_cause));
+			switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Hangup-Cause", "%s", switch_channel_cause2str(channel->hangup_cause));
 			switch_channel_event_set_data(channel, event);
 			switch_event_fire(&event);
 		}

Modified: freeswitch/trunk/src/switch_core.c
==============================================================================
--- freeswitch/trunk/src/switch_core.c	(original)
+++ freeswitch/trunk/src/switch_core.c	Mon Feb 12 23:43:49 2007
@@ -760,7 +760,7 @@
 
 	if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
 		switch_channel_event_set_data(session->channel, event);
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-name", codec->implementation->iananame);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-name", "%s", codec->implementation->iananame);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-read-codec-rate", "%d", codec->implementation->samples_per_second);
 		switch_event_fire(&event);
 	}
@@ -781,7 +781,7 @@
 
 	if (switch_event_create(&event, SWITCH_EVENT_CODEC) == SWITCH_STATUS_SUCCESS) {
 		switch_channel_event_set_data(session->channel, event);
-		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", codec->implementation->iananame);
+		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-name", "%s", codec->implementation->iananame);
 		switch_event_add_header(event, SWITCH_STACK_BOTTOM, "channel-write-codec-rate", "%d", codec->implementation->samples_per_second);
 		switch_event_fire(&event);
 	}

Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c	(original)
+++ freeswitch/trunk/src/switch_event.c	Mon Feb 12 23:43:49 2007
@@ -439,7 +439,7 @@
 
 	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_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_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) {

Modified: freeswitch/trunk/src/switch_ivr.c
==============================================================================
--- freeswitch/trunk/src/switch_ivr.c	(original)
+++ freeswitch/trunk/src/switch_ivr.c	Mon Feb 12 23:43:49 2007
@@ -2531,7 +2531,7 @@
                 if ((inner_var_count = 
                      switch_separate_string(var_array[x], '=', inner_var_array, (sizeof(inner_var_array) / sizeof(inner_var_array[0])))) == 2) {
                     
-                    switch_event_add_header(var_event, SWITCH_STACK_BOTTOM, inner_var_array[0], inner_var_array[1]);
+                    switch_event_add_header(var_event, SWITCH_STACK_BOTTOM, inner_var_array[0], "%s", inner_var_array[1]);
                     if (caller_channel) {
                         switch_channel_set_variable(caller_channel, inner_var_array[0], inner_var_array[1]);
                     }
@@ -3186,7 +3186,7 @@
 			&& (other_session = switch_core_session_locate(other_uuid))) {
 			if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
 				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", "%s", app);
 				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-arg", "%s", path);
 				switch_core_session_queue_private_event(other_session, &event);
 			}
@@ -3198,7 +3198,7 @@
 		if ((flags & SMF_ECHO_ALEG)) {
 			if (switch_event_create(&event, SWITCH_EVENT_MESSAGE) == SWITCH_STATUS_SUCCESS) {
 				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "call-command", "execute");
-				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", app);
+				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-name", "%s", app);
 				switch_event_add_header(event, SWITCH_STACK_BOTTOM, "execute-app-arg", "%s", path);
 				switch_core_session_queue_private_event(session, &event);
 			}

Modified: freeswitch/trunk/src/switch_loadable_module.c
==============================================================================
--- freeswitch/trunk/src/switch_loadable_module.c	(original)
+++ freeswitch/trunk/src/switch_loadable_module.c	Mon Feb 12 23:43:49 2007
@@ -834,10 +834,10 @@
 
 	if (stream->event) {
 		if (cmd) {
-			switch_event_add_header(stream->event, SWITCH_STACK_BOTTOM, "API-Command", cmd);
+			switch_event_add_header(stream->event, SWITCH_STACK_BOTTOM, "API-Command", "%s", cmd);
 		}
 		if (arg) {
-			switch_event_add_header(stream->event, SWITCH_STACK_BOTTOM, "API-Command-Argument", arg);
+			switch_event_add_header(stream->event, SWITCH_STACK_BOTTOM, "API-Command-Argument", "%s", arg);
 		}
 	}
 



More information about the Freeswitch-svn mailing list