]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-11911: Fix build on Debian Buster
authorAndrey Volk <andywolk@gmail.com>
Wed, 19 Jun 2019 19:53:35 +0000 (23:53 +0400)
committerAndrey Volk <andywolk@gmail.com>
Mon, 15 Jul 2019 18:23:25 +0000 (22:23 +0400)
24 files changed:
debian/bootstrap.sh
debian/control-modules
libs/esl/fs_cli.c
libs/esl/src/esl.c
libs/esl/src/include/esl.h
libs/esl/src/include/esl_config.h
libs/miniupnpc/minissdpc.c
libs/sofia-sip/libsofia-sip-ua/su/su_strdup.c
src/include/switch_platform.h
src/mod/applications/mod_redis/credis.c
src/mod/applications/mod_signalwire/mod_signalwire.c
src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia_reg.c
src/mod/endpoints/mod_verto/mcast/mcast.h
src/mod/endpoints/mod_verto/ws.h
src/mod/event_handlers/mod_kazoo/kazoo_commands.c
src/mod/say/mod_say_ja/mod_say_ja.c
src/mod/xml_int/mod_xml_rpc/ws.h
src/switch_core_db.c
src/switch_core_media.c
src/switch_core_sqldb.c
src/switch_ivr_play_say.c
src/switch_loadable_module.c
src/switch_nat.c

index 6e52c2db8e9a95a00135f87a7134da943b02f3db..a2ab31a202d86bb8277ecaffbaf5581335672781 100755 (executable)
@@ -28,7 +28,7 @@ conf_dir="../conf"
 lang_dir="../conf/vanilla/lang"
 fs_description="FreeSWITCH is a scalable open source cross-platform telephony platform designed to route and interconnect popular communication protocols using audio, video, text or any other form of media."
 mod_build_depends="." mod_depends="." mod_recommends="." mod_suggests="."
-supported_debian_distros="wheezy jessie stretch sid"
+supported_debian_distros="wheezy jessie stretch buster sid"
 supported_ubuntu_distros="trusty utopic xenial"
 supported_distros="$supported_debian_distros $supported_ubuntu_distros"
 avoid_mods=(
index ba9dda780673b0be7cf056d43f33239565417838..2d8bbc27cea7f95c158be4131fa6f6d9ea64cfe4 100644 (file)
@@ -479,6 +479,7 @@ Module: endpoints/mod_verto
 Description: Adds mod_verto.
  Adds mod_verto.
 Build-Depends: libperl-dev
+Build-Depends-Buster: libperl-dev, libgdbm-compat-dev
 
 ## mod/event_handlers
 
@@ -635,7 +636,7 @@ Description: Adds mod_basic.
 Module: languages/mod_java
 Description: mod_java
  Adds mod_java.
-Build-Depends: default-jdk, gcj-jdk
+Build-Depends: default-jdk
 
 Module: languages/mod_lua
 Description: mod_lua
@@ -651,6 +652,7 @@ Module: languages/mod_perl
 Description: mod_perl
  Adds mod_perl.
 Build-Depends: libperl-dev
+Build-Depends-Buster: libperl-dev, libgdbm-compat-dev
 
 Module: languages/mod_python
 Description: mod_python
index 609d9e2e0041882071a20e2497e26f376da4018c..a77ce015753b41ab10200bb837297eeef59dee71 100644 (file)
@@ -50,7 +50,7 @@ static unsigned char esl_console_complete(const char *buffer, const char *cursor
 #endif
 
 typedef struct {
-       char name[128];
+       char name[256];
        char host[128];
        esl_port_t port;
        char user[256];
@@ -1267,7 +1267,7 @@ static void read_config(const char *dft_cfile, const char *cfile) {
        if (esl_config_open_file(&cfg, cfile) ||
                esl_config_open_file(&cfg, dft_cfile)) {
                char *var, *val;
-               char cur_cat[128] = "";
+               char cur_cat[256] = "";
                while (esl_config_next_pair(&cfg, &var, &val)) {
                        if (strcmp(cur_cat, cfg.category)) {
                                esl_set_string(cur_cat, cfg.category);
@@ -1470,7 +1470,7 @@ int main(int argc, char *argv[])
        int argv_error = 0;
        int argv_exec = 0;
        char argv_command[1024] = "";
-       char argv_loglevel[128] = "";
+       char argv_loglevel[127] = "";
        int argv_log_uuid = 0;
        int argv_log_uuid_short = 0;
        int argv_quiet = 0;
index 3f00a209f945583efac04f03b7ae508d976c8b8c..923ae966f4646b60b58d5f845a140cbf4fee252f 100644 (file)
@@ -1399,7 +1399,7 @@ ESL_DECLARE(esl_status_t) esl_recv_event(esl_handle_t *handle, int check_q, esl_
                hval = esl_event_get_header(revent, "reply-text");
 
                if (!esl_strlen_zero(hval)) {
-                       strncpy(handle->last_reply, hval, sizeof(handle->last_reply));
+                       snprintf(handle->last_reply, sizeof(handle->last_reply), "%s", hval);
                }
 
                hval = esl_event_get_header(revent, "content-type");
@@ -1597,7 +1597,7 @@ ESL_DECLARE(esl_status_t) esl_send_recv_timed(esl_handle_t *handle, const char *
                        hval = esl_event_get_header(handle->last_sr_event, "reply-text");
 
                        if (!esl_strlen_zero(hval)) {
-                               strncpy(handle->last_sr_reply, hval, sizeof(handle->last_sr_reply));
+                               snprintf(handle->last_sr_reply, sizeof(handle->last_sr_reply), "%s", hval);
                        }               
                }
        }
index 0904b180309219f18b3b58619d9e76f85df7ffc3..4d2baac871ad87c024f03df1e5354e1ba89d850a 100644 (file)
@@ -40,8 +40,8 @@
 extern "C" {
 #endif /* defined(__cplusplus) */
 
-#define esl_copy_string(_x, _y, _z) strncpy(_x, _y, _z - 1)
-#define esl_set_string(_x, _y) esl_copy_string(_x, _y, sizeof(_x))
+#define esl_copy_string(_x, _y, _z) snprintf(_x, _z, "%s", _y)
+#define esl_set_string(_x, _y)  esl_copy_string(_x, _y, sizeof(_x))
 #define ESL_VA_NONE "%s", ""
 
 typedef struct esl_event_header esl_event_header_t;
index 03bbe9719be3ab6dd4701f3cbb07628e928154b8..44a485895b0f7358b6d383c942e43af53ceca77c 100644 (file)
@@ -113,7 +113,7 @@ struct esl_config {
        /*! FILE stream buffer to the opened file */
        FILE *file;
        /*! path to the file */
-       char path[512];
+       char path[1024];
        /*! current category */
        char category[256];
        /*! current section */
index 0bea0188d22c5b678ae4a306946c365b73166545..aa939fb7fb27e9721429160da19329a7ec96c519 100644 (file)
@@ -58,7 +58,7 @@ getDevicesFromMiniSSDPD(const char * devtype, const char * socketpath)
                return NULL;
        }
        addr.sun_family = AF_UNIX;
-       strncpy(addr.sun_path, socketpath, sizeof(addr.sun_path));
+       memcpy(addr.sun_path, socketpath, sizeof(addr.sun_path));
        if(connect(s, (struct sockaddr *)&addr, sizeof(struct sockaddr_un)) < 0)
        {
                /*syslog(LOG_WARNING, "connect(\"%s\"): %m", socketpath);*/
index 773f93844967637c026e03434c602a41cab4effb..6d5c59dc8fb8506e2d7927af53be5fb8d0d908e7 100644 (file)
@@ -34,6 +34,7 @@
 #include "config.h"
 
 #include <string.h>
+#include <stdio.h>
 #include "sofia-sip/su_alloc.h"
 
 /** Duplicate a string, allocate memory from @a home.
@@ -54,7 +55,7 @@ char *su_strdup(su_home_t *home, char const *s)
     size_t n = strlen(s);
     char *retval = su_alloc(home, n + 1);
     if (retval)
-      strncpy(retval, s, n)[n] = 0;
+      snprintf(retval, n + 1, "%s", s);
     return retval;
   }
   return NULL;
index cb78bb2c135e84aea471694697e3732bfee1a87b..005378d392811305a14039c1d6c380b68f6cbcb6 100644 (file)
@@ -111,10 +111,6 @@ typedef int gid_t;
 #include <io.h>
 #define strcasecmp(s1, s2) stricmp(s1, s2)
 #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
-#if _MSC_VER < 1900
-#define snprintf _snprintf
-#endif
-
 #else
 /* packed attribute */
 #if (defined __SUNPRO_CC) || defined(__SUNPRO_C)
index 0eba45dafa2e5cf4204883143f19e99b7ff7a486..61467f2776bed9d4ba8499a93ca2d85e920db2fd 100644 (file)
@@ -35,9 +35,6 @@
 #ifdef  _MSC_VER
 #include <io.h>
 #include <WinSock2.h>
-#if _MSC_VER < 1900
-#define snprintf _snprintf
-#endif
 typedef SOCKET credis_socket_t;
 #define CREDIS_SOCK_INVALID INVALID_SOCKET
 #else
index ad2b15b3d3939b4e64f10dec45e645af6057df62..b07b87384d5bd63006c934f83bcec27181bc19af 100644 (file)
@@ -302,7 +302,7 @@ static ks_status_t mod_signalwire_adoption_post(void)
                        status = KS_STATUS_FAIL;
                        goto done;
                }
-               strncpy(globals.adoption_data_external_ip, external_ip, sizeof(globals.adoption_data_external_ip));
+               snprintf(globals.adoption_data_external_ip, sizeof(globals.adoption_data_external_ip), "%s", external_ip);
        }
 
        if (!globals.adoption_data_uname[0]) {
@@ -609,7 +609,7 @@ static switch_status_t mod_signalwire_load_or_generate_token(void)
                        token[len - 1] = '\0';
                }
 
-               strncpy(globals.adoption_token, token, sizeof(globals.adoption_token) - 1);
+               snprintf(globals.adoption_token, sizeof(globals.adoption_token), "%s", token);
        }
 
        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO,
@@ -674,7 +674,7 @@ static switch_status_t load_config()
        }
 
        if ((data = getenv("SW_ADOPTION_SERVICE"))) {
-               strncpy(globals.adoption_service, data, sizeof(globals.adoption_service));
+               snprintf(globals.adoption_service, sizeof(globals.adoption_service), "%s", data);
        }
 
        swclt_config_load_from_env(globals.config);
@@ -1032,7 +1032,7 @@ static void mod_signalwire_state_online(void)
 static void mod_signalwire_state_configure(void)
 {
        switch_memory_pool_t *pool = NULL;
-       char local_ip[256];
+       char local_ip[64];
        switch_port_t local_port = 6050;
        char local_endpoint[256];
        char *external_ip;
index 0da976608d88b347b6c5a58a0ba0679abd05b6d3..46e2990614683618f49b168460af82d097ea8953 100644 (file)
@@ -5760,7 +5760,7 @@ void general_event_handler(switch_event_t *event)
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "EVENT_TRAP: IP change detected\n");
                                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "IP change detected [%s]->[%s] [%s]->[%s]\n", old_ip4, new_ip4, old_ip6, new_ip6);
 
-                               strncpy(mod_sofia_globals.guess_ip, new_ip4, sizeof(mod_sofia_globals.guess_ip));
+                               snprintf(mod_sofia_globals.guess_ip, sizeof(mod_sofia_globals.guess_ip), "%s", new_ip4);
 
                                switch_mutex_lock(mod_sofia_globals.hash_mutex);
                                if (mod_sofia_globals.profile_hash) {
index c8b358b8a96fc719270bcfd27bcdb1a79d33c263..d8c6f510e94765af6c15208ab783a785bb22306a 100644 (file)
@@ -2412,7 +2412,7 @@ void sofia_reg_handle_sip_r_register(int status,
 
                if (de && de->data && de->data->e_msg) {
                        if (!zstr_buf(gateway->register_network_ip)) {
-                               strncpy(oregister_network_ip, gateway->register_network_ip, sizeof(oregister_network_ip) - 1);
+                               snprintf(oregister_network_ip, sizeof(oregister_network_ip), "%s", gateway->register_network_ip);
                        }
                        sofia_glue_get_addr(de->data->e_msg, network_ip, sizeof(network_ip), &gateway->register_network_port);
                        if (!zstr_buf(network_ip)) {
index ace34fe7bc3d8346ae3982525452572995837835..75fa0d173bb58622e63bf83a59513d40e3852d57 100644 (file)
@@ -56,9 +56,6 @@ extern "C" {
 #ifndef strncasecmp
 #define strncasecmp _strnicmp
 #endif
-#if _MSC_VER < 1900
-#define snprintf _snprintf
-#endif
 #ifdef _WIN64
 #define WS_SSIZE_T __int64
 #elif _MSC_VER >= 1400
index 58bbaee31620c22714472aac2930b94d247ccacc..84127cfb2cf8ea300e0b9c7e807b7747c4236afc 100644 (file)
@@ -40,9 +40,6 @@
 #ifndef strncasecmp
 #define strncasecmp _strnicmp
 #endif
-#if _MSC_VER < 1900
-#define snprintf _snprintf
-#endif
 #ifdef _WIN64
 #define WS_SSIZE_T __int64
 #elif _MSC_VER >= 1400
index d61a1054ac7e93655ba672b678f79e2a90770f48..f798d027b7e010ef87b7b226166da7b88504f3dc 100644 (file)
@@ -333,8 +333,7 @@ static size_t header_callback(char *buffer, size_t size, size_t nitems, void *us
        int len = strlen(buffer);
        char buf[1024];
        if(len > 2 && len < 1024) {
-               strncpy(buf, buffer, len-2);
-               buf[len-2] = '\0';
+               snprintf(buf, sizeof(buf), "%s", buffer);
                switch_event_add_header_string(event, SWITCH_STACK_PUSH | SWITCH_STACK_BOTTOM, "Reply-Headers", buf);
        }
        return nitems * size;
index d8e0692fd0935b1cfac71664d5592d567c4cb3bb..98f05898ad43edc48c03d8568cc73e7f2976c67e 100644 (file)
@@ -252,7 +252,7 @@ static switch_status_t ja_say_time(switch_core_session_t *session, char *tosay,
        const char *tz = switch_channel_get_variable(channel, "timezone");
 
        int mod_min;
-       char buffer[3];
+       char buffer[11];
 
 
        if (say_args->type == SST_TIME_MEASUREMENT) {
index 4c9e47140254d5089f6ca22ec84a7b429478e9ce..eda49b20e71d7c29145eebb62b2cb31cba94d02c 100644 (file)
@@ -13,9 +13,6 @@
 #include <sys/socket.h>
 #else
 #pragma warning(disable:4996)
-#if _MSC_VER < 1900
-#define snprintf _snprintf
-#endif
 #endif
 #include <string.h>
 #include <string.h>
index d89fbdd4874ca2ba490403f7d60b5f2d15d2ece6..14fb2f09eab941c01c83fbd55fdf9a972daafb35 100644 (file)
@@ -39,7 +39,7 @@ static void db_pick_path(const char *dbname, char *buf, switch_size_t size)
 {
        memset(buf, 0, size);
        if (switch_is_file_path(dbname)) {
-               strncpy(buf, dbname, size);
+               strncpy(buf, dbname, size-1);
        } else {
                switch_snprintf(buf, size, "%s%s%s.db", SWITCH_GLOBAL_dirs.db_dir, SWITCH_PATH_SEPARATOR, dbname);
        }
index 10df7fbc9eb9df7cf9224b8a80d06cb55b1c7db6..f34613870fda9939169925a38eb749796f582696 100644 (file)
@@ -11921,7 +11921,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
                        memcpy(q, strchr(a_engine->adv_sdp_ip, ':') ? "6 " : "4 ", 2);
                        p +=2;
                        q +=2;
-                       strncpy(q, a_engine->adv_sdp_ip, strlen(a_engine->adv_sdp_ip));
+                       snprintf(q, qe - q, "%s", a_engine->adv_sdp_ip);
                        q += strlen(a_engine->adv_sdp_ip);
 
                        while (p && *p && ((*p >= '0' && *p <= '9') || *p == '.' || *p == ':' || (*p >= 'A' && *p <= 'F') || (*p >= 'a' && *p <= 'f'))) {
@@ -11967,7 +11967,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
                                snprintf(o_line, sizeof(o_line), "o=%s %010u %010u IN %s %s\r\n",
                                                 smh->mparams->sdp_username, smh->owner_id, smh->session_id, family, smh->mparams->sipip);
 
-                               strncpy(q, o_line, strlen(o_line));
+                               snprintf(q, qe-q, "%s", o_line);
                                q += strlen(o_line) - 1;
 
                        }
@@ -11988,8 +11988,8 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
                                p += len;
 
                                snprintf(s_line, sizeof(s_line), "s=%s\r\n", smh->mparams->sdp_username);
+                               snprintf(q, qe-q, "%s", s_line);
 
-                               strncpy(q, s_line, strlen(s_line));
                                q += strlen(s_line) - 1;
 
                        }
@@ -12012,7 +12012,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
                        }
 
 
-                       strncpy(q, port_buf, strlen(port_buf));
+                       snprintf(q, qe - q, "%s", port_buf);
                        q += strlen(port_buf);
 
                        if (q >= qe) {
@@ -12074,7 +12074,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
                                goto end;
                        }
 
-                       strncpy(q, vport_buf, strlen(vport_buf));
+                       snprintf(q, qe-q, "%s", vport_buf);
                        q += strlen(vport_buf);
 
                        if (q >= qe) {
@@ -12137,7 +12137,7 @@ SWITCH_DECLARE(void) switch_core_media_patch_sdp(switch_core_session_t *session)
                                goto end;
                        }
 
-                       strncpy(q, tport_buf, strlen(tport_buf));
+                       snprintf(q, qe-q, "%s", tport_buf);
                        q += strlen(tport_buf);
 
                        if (q >= qe) {
index c73abc47b9644e6ca71b5c6ee610c8c4f3cdfbf4..0a2e732cda2abb3885b21de8ea264ce1e381285f 100644 (file)
@@ -4160,7 +4160,7 @@ SWITCH_DECLARE(void) switch_cache_db_status(switch_stream_handle_t *stream)
                        }
                }
                if (i == 3) {
-                       strncpy(cleankey_str, dbh->name, strlen(dbh->name));
+                       snprintf(cleankey_str, sizeof(cleankey_str), "%s", dbh->name);
                }
 
                count++;
index 908ca2e8aafcea006032abaddce1cf3f6286d23a..8063d5cb10bb615845341dd2673f7ac4c81c406b 100644 (file)
@@ -2711,11 +2711,11 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_speak_text_handle(switch_core_session
                memset(tmp, 0, mylen);
                tp = tmp;
                for (p = text; p && *p; p++) {
-                       if (*p == '*') {
-                               strncat(tp, star, starlen);
+                       if (*p == '*' ) {
+                               snprintf(tp + strlen(tp), sizeof(tp) - strlen(tp), "%s", star);
                                tp += starlen;
                        } else if (*p == '#') {
-                               strncat(tp, pound, poundlen);
+                               snprintf(tp + strlen(tp), sizeof(tp) - strlen(tp), "%s", pound);
                                tp += poundlen;
                        } else {
                                *tp++ = *p;
index 491bf16583b131da9dbcbe2a173b845239947f40..e8f2564b7ead5d66e2cd213ba0a458956d57cca4 100644 (file)
@@ -157,7 +157,7 @@ static switch_status_t switch_loadable_module_process(char *key, switch_loadable
 {
        switch_event_t *event;
        int *event_num = NULL;
-       char str_event_num[10];
+       char str_event_num[12];
        void *val;
        int added = 0;
 
index 93742bf3fdea16b6ee523d6688be3d132c36ed1c..5b3fa5d54338df180bb979d2b72690c0a199f1c0 100644 (file)
@@ -427,7 +427,7 @@ SWITCH_DECLARE(void) switch_nat_init(switch_memory_pool_t *pool, switch_bool_t m
                switch_core_set_variable("nat_public_addr", nat_globals.pub_addr);
                switch_core_set_variable("nat_private_addr", nat_globals.pvt_addr);
                switch_core_set_variable("nat_type", nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp");
-               strncpy(nat_globals.nat_type_str, nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", sizeof(nat_globals.nat_type_str) - 1);
+               strncpy(nat_globals.nat_type_str, nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", sizeof(nat_globals.nat_type_str));
                switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "NAT detected type: %s, ExtIP: '%s'\n",
                                                  nat_globals.nat_type == SWITCH_NAT_TYPE_PMP ? "pmp" : "upnp", nat_globals.pub_addr);