]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Fix off-by-1 read err in switch_xml
authorMathieu Rene <mrene@avgs.ca>
Mon, 16 Mar 2009 20:28:22 +0000 (20:28 +0000)
committerMathieu Rene <mrene@avgs.ca>
Mon, 16 Mar 2009 20:28:22 +0000 (20:28 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12628 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_conference/mod_conference.c
src/mod/codecs/mod_g729/Makefile
src/mod/codecs/mod_g729/mod_g729.c
src/mod/endpoints/mod_reference/mod_reference.c
src/mod/endpoints/mod_sofia/sofia.c
src/switch_xml.c

index 8fd8b73b9a3caf6dd14d168cecbabda696e15cee..b87d21cce60ea72c77e78c1c9e303f91b75a8645 100644 (file)
@@ -2922,7 +2922,7 @@ static switch_status_t conf_api_sub_kick(conference_member_t *member, switch_str
 {
        switch_event_t *event;
 
-       if (member == NULL)
+       if (member == NULL || switch_test_flag(member, MFLAG_NOCHANNEL))
                return SWITCH_STATUS_GENERR;
 
        switch_mutex_lock(member->control_mutex);
index c89a136d8ebcc53ef63dc54b5aa667d3b2317b6b..10b182ac185241d5e4562abc12eb607d9b839139 100644 (file)
@@ -1,7 +1,7 @@
 BASE=../../../..
-DIR=$(BASE)/libs/libg729
-A=$(DIR)/.libs/libg729.a
+DIR=./g729abc
+A=$(DIR)/libg729ab.a
 
-LOCAL_INSERT_CFLAGS=if test -f $(A); then echo "-I$(DIR)/src/include" ; else echo "-DG729_PASSTHROUGH" ; fi ;
+LOCAL_INSERT_CFLAGS=if test -f $(A); then echo "-I$(DIR)" ; else echo "-DG729_PASSTHROUGH" ; fi ;
 LOCAL_INSERT_LDFLAGS=test ! -f $(A) || echo $(A) 
 include $(BASE)/build/modmake.rules
index b3e0fe8e68dee11c096d6e8d2f2e6077bdbfc5b7..246cced3d1c73206e985edfbf6e03d662084282d 100644 (file)
@@ -38,7 +38,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_g729_load);
 SWITCH_MODULE_DEFINITION(mod_g729, mod_g729_load, NULL, NULL);
 
 #ifndef G729_PASSTHROUGH
-#include "g729.h"
+#include "g729ab.h"
 
 struct g729_context {
        struct dec_state decoder_object;
@@ -112,7 +112,7 @@ static switch_status_t switch_g729_encode(switch_codec_t *codec,
        if (decoded_data_len % 160 == 0) {
                uint32_t new_len = 0;
                INT16 *ddp = decoded_data;
-               char *edp = encoded_data;
+               unsigned char *edp = encoded_data;
                int x;
                int loops = (int) decoded_data_len / 160;
 
@@ -170,7 +170,7 @@ static switch_status_t switch_g729_decode(switch_codec_t *codec,
                if (encoded_data_len % divisor == 0) {
                        uint8_t *test;
                        int loops = (int) encoded_data_len / divisor;
-                       char *edp = encoded_data;
+                       unsigned char *edp = encoded_data;
                        short *ddp = decoded_data;
                        int x;
                        uint32_t new_len = 0;
index 60abb501e3d3d8b4a11e9b084af6387d0137ce38..5abe9d053fdfbeb1e1a978920c9755d628bab02c 100644 (file)
@@ -272,8 +272,6 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch
 {
        switch_channel_t *channel = NULL;
        private_t *tech_pvt = NULL;
-       switch_time_t started = switch_time_now();
-       unsigned int elapsed;
        switch_byte_t *data;
 
        channel = switch_core_session_get_channel(session);
index a1500ccde914c11339d574a36a4c0ebb7e38e7bf..c749549d660f06229d76cdad73988687b7136225 100644 (file)
@@ -2691,7 +2691,7 @@ static void sofia_handle_sip_r_invite(switch_core_session_t *session, int status
                        }
                }
 
-               if (channel && sip && (status >= 300 || status < 399) && switch_channel_test_flag(channel, CF_OUTBOUND)) {
+               if (channel && sip && (status >= 300 && status < 399) && switch_channel_test_flag(channel, CF_OUTBOUND)) {
                        sip_contact_t * p_contact = sip->sip_contact;
                        int i = 0;
                        char var_name[80];      
index e881f7a764ff8d57e1168a5111c00a38ff047e4b..0b0426c1cf281e26a47b92ee7d54418e74fce80e 100644 (file)
@@ -2035,7 +2035,7 @@ static char *switch_xml_toxml_r(switch_xml_t xml, char **s, switch_size_t *len,
                *s = tmp;
        }
 
-       if (*(*s + (*len) - 1) == '>') {
+       if (*len && *(*s + (*len) - 1) == '>') {
                *len += sprintf(*s + *len, "\n");       /* indent */
        }
        for (lcount = 0; lcount < *count; lcount++) {