From 657b380452693050662aca748edea29db3f98ff5 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Mon, 11 Feb 2008 06:45:03 +0000 Subject: [PATCH] fix length error introduced in r6827 (should fix MODEVENT-15) git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7580 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- .../event_handlers/mod_event_multicast/mod_event_multicast.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c index ed9445566f..4ecd15e82e 100644 --- a/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c +++ b/src/mod/event_handlers/mod_event_multicast/mod_event_multicast.c @@ -171,7 +171,7 @@ static void event_handler(switch_event_t *event) switch_event_add_header(event, SWITCH_STACK_BOTTOM, "Multicast-Sender", "%s", globals.hostname); if (switch_event_serialize(event, &packet, SWITCH_TRUE) == 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)); + switch_copy_string(buf + sizeof(globals.host_hash), packet, MULTICAST_BUFFSIZE - sizeof(globals.host_hash)); len = strlen(packet) + sizeof(globals.host_hash);; //switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "\nEVENT\n--------------------------------\n%s\n", buf); switch_socket_sendto(globals.udp_socket, globals.addr, 0, buf, &len); @@ -270,7 +270,7 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime) globals.running = 1; while (globals.running == 1) { char *myaddr; - size_t len = sizeof(buf); + size_t len = MULTICAST_BUFFSIZE; memset(buf, 0, len); switch_sockaddr_ip_get(&myaddr, globals.addr);