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=(
Description: Adds mod_verto.
Adds mod_verto.
Build-Depends: libperl-dev
+Build-Depends-Buster: libperl-dev, libgdbm-compat-dev
## mod/event_handlers
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
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
#endif
typedef struct {
- char name[128];
+ char name[256];
char host[128];
esl_port_t port;
char user[256];
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);
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;
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");
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);
}
}
}
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;
/*! 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 */
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);*/
#include "config.h"
#include <string.h>
+#include <stdio.h>
#include "sofia-sip/su_alloc.h"
/** Duplicate a string, allocate memory from @a home.
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;
#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)
#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
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]) {
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,
}
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);
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;
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) {
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)) {
#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
#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
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;
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) {
#include <sys/socket.h>
#else
#pragma warning(disable:4996)
-#if _MSC_VER < 1900
-#define snprintf _snprintf
-#endif
#endif
#include <string.h>
#include <string.h>
{
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);
}
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'))) {
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;
}
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;
}
}
- strncpy(q, port_buf, strlen(port_buf));
+ snprintf(q, qe - q, "%s", port_buf);
q += strlen(port_buf);
if (q >= qe) {
goto end;
}
- strncpy(q, vport_buf, strlen(vport_buf));
+ snprintf(q, qe-q, "%s", vport_buf);
q += strlen(vport_buf);
if (q >= qe) {
goto end;
}
- strncpy(q, tport_buf, strlen(tport_buf));
+ snprintf(q, qe-q, "%s", tport_buf);
q += strlen(tport_buf);
if (q >= qe) {
}
}
if (i == 3) {
- strncpy(cleankey_str, dbh->name, strlen(dbh->name));
+ snprintf(cleankey_str, sizeof(cleankey_str), "%s", dbh->name);
}
count++;
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;
{
switch_event_t *event;
int *event_num = NULL;
- char str_event_num[10];
+ char str_event_num[12];
void *val;
int added = 0;
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);