Merge pull request #1639 in FS/freeswitch from ~SAFAROV/freeswitch2:gcc8 to master

* commit 'abde630feab06adfc6b2773bf03b4c699861e9c5':
  FS-11345: Fixed Werror=stringop-truncation for mod_opus
This commit is contained in:
Mike Jerris 2018-12-12 21:38:59 +00:00
commit f391645e4f
9 changed files with 19 additions and 20 deletions

View File

@ -315,7 +315,7 @@ int tport_open_log(tport_master_t *mr, tagi_t *tags)
/** Create log stamp */ /** Create log stamp */
void tport_stamp(tport_t const *self, msg_t *msg, void tport_stamp(tport_t const *self, msg_t *msg,
char stamp[128], char const *what, char stamp[512], char const *what,
size_t n, char const *via, size_t n, char const *via,
su_time_t now) su_time_t now)
{ {
@ -357,7 +357,7 @@ void tport_stamp(tport_t const *self, msg_t *msg,
su_inet_ntop(su->su_family, SU_ADDR(su), name, sizeof(name)); su_inet_ntop(su->su_family, SU_ADDR(su), name, sizeof(name));
snprintf(stamp, 128, snprintf(stamp, 144,
"%s "MOD_ZU" bytes %s %s/[%s]:%u%s%s at %02u:%02u:%02u.%06lu:\n", "%s "MOD_ZU" bytes %s %s/[%s]:%u%s%s at %02u:%02u:%02u.%06lu:\n",
what, (size_t)n, via, self->tp_name->tpn_proto, what, (size_t)n, via, self->tp_name->tpn_proto,
name, ntohs(su->su_port), label[0] ? label : "", comp, name, ntohs(su->su_port), label[0] ? label : "", comp,

View File

@ -254,10 +254,10 @@ int ws_handshake(wsh_t *wsh)
char version[5] = ""; char version[5] = "";
char proto[256] = ""; char proto[256] = "";
char proto_buf[384] = ""; char proto_buf[384] = "";
char input[256] = ""; char input[512] = "";
unsigned char output[SHA1_HASH_SIZE] = ""; unsigned char output[SHA1_HASH_SIZE] = "";
char b64[256] = ""; char b64[256] = "";
char respond[512] = ""; char respond[1024] = "";
ssize_t bytes; ssize_t bytes;
char *p, *e = 0; char *p, *e = 0;

View File

@ -252,7 +252,8 @@ SWITCH_STANDARD_APP(soundtouch_start_function)
char *argv[6]; char *argv[6];
int argc; int argc;
char *lbuf = NULL; char *lbuf = NULL;
int x, n; int x;
int n=0;
if ((bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_soundtouch_"))) { if ((bug = (switch_media_bug_t *) switch_channel_get_private(channel, "_soundtouch_"))) {
if (!zstr(data) && !strcasecmp(data, "stop")) { if (!zstr(data) && !strcasecmp(data, "stop")) {
@ -334,7 +335,6 @@ SWITCH_STANDARD_API(soundtouch_api_function)
char *argv[10] = { 0 }; char *argv[10] = { 0 };
char *uuid = NULL; char *uuid = NULL;
char *action = NULL; char *action = NULL;
char *lbuf = NULL;
int x, n; int x, n;
if (zstr(cmd)) { if (zstr(cmd)) {

View File

@ -207,19 +207,19 @@ static uint32_t switch_opus_encoder_set_audio_bandwidth(OpusEncoder *encoder_obj
static switch_bool_t switch_opus_show_audio_bandwidth(int audiobandwidth,char *audiobandwidth_str) static switch_bool_t switch_opus_show_audio_bandwidth(int audiobandwidth,char *audiobandwidth_str)
{ {
if (audiobandwidth == OPUS_BANDWIDTH_NARROWBAND) { if (audiobandwidth == OPUS_BANDWIDTH_NARROWBAND) {
strncpy(audiobandwidth_str, "NARROWBAND",10); strncpy(audiobandwidth_str, "NARROWBAND",11);
return SWITCH_TRUE; return SWITCH_TRUE;
} else if (audiobandwidth == OPUS_BANDWIDTH_MEDIUMBAND) { } else if (audiobandwidth == OPUS_BANDWIDTH_MEDIUMBAND) {
strncpy(audiobandwidth_str, "MEDIUMBAND",10); strncpy(audiobandwidth_str, "MEDIUMBAND",11);
return SWITCH_TRUE; return SWITCH_TRUE;
} else if (audiobandwidth == OPUS_BANDWIDTH_WIDEBAND) { } else if (audiobandwidth == OPUS_BANDWIDTH_WIDEBAND) {
strncpy(audiobandwidth_str,"WIDEBAND",8); strncpy(audiobandwidth_str,"WIDEBAND",9);
return SWITCH_TRUE; return SWITCH_TRUE;
} else if (audiobandwidth == OPUS_BANDWIDTH_SUPERWIDEBAND) { } else if (audiobandwidth == OPUS_BANDWIDTH_SUPERWIDEBAND) {
strncpy(audiobandwidth_str, "SUPERWIDEBAND",13); strncpy(audiobandwidth_str, "SUPERWIDEBAND",14);
return SWITCH_TRUE; return SWITCH_TRUE;
} else if (audiobandwidth == OPUS_BANDWIDTH_FULLBAND) { } else if (audiobandwidth == OPUS_BANDWIDTH_FULLBAND) {
strncpy(audiobandwidth_str, "FULLBAND",8); strncpy(audiobandwidth_str, "FULLBAND",9);
return SWITCH_TRUE; return SWITCH_TRUE;
} }
return SWITCH_FALSE; return SWITCH_FALSE;

View File

@ -254,10 +254,10 @@ int ws_handshake(wsh_t *wsh)
char version[5] = ""; char version[5] = "";
char proto[256] = ""; char proto[256] = "";
char proto_buf[384] = ""; char proto_buf[384] = "";
char input[256] = ""; char input[512] = "";
unsigned char output[SHA1_HASH_SIZE] = ""; unsigned char output[SHA1_HASH_SIZE] = "";
char b64[256] = ""; char b64[256] = "";
char respond[512] = ""; char respond[1024] = "";
ssize_t bytes; ssize_t bytes;
char *p, *e = 0; char *p, *e = 0;

View File

@ -118,7 +118,6 @@ int docall(lua_State * L, int narg, int nresults, int perror, int fatal)
static lua_State *lua_init(void) static lua_State *lua_init(void)
{ {
lua_State *L = luaL_newstate(); lua_State *L = luaL_newstate();
int error = 0;
if (L) { if (L) {
const char *buff = "os.exit = function() freeswitch.consoleLog(\"err\", \"Surely you jest! exiting is a bad plan....\\n\") end"; const char *buff = "os.exit = function() freeswitch.consoleLog(\"err\", \"Surely you jest! exiting is a bad plan....\\n\") end";
@ -127,7 +126,7 @@ static lua_State *lua_init(void)
luaopen_freeswitch(L); luaopen_freeswitch(L);
lua_gc(L, LUA_GCRESTART, 0); lua_gc(L, LUA_GCRESTART, 0);
lua_atpanic(L, panic); lua_atpanic(L, panic);
error = luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 0, 0, 1); luaL_loadbuffer(L, buff, strlen(buff), "line") || docall(L, 0, 0, 0, 1);
} }
return L; return L;
} }