diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c index 237dc483c0..39c445ba5c 100644 --- a/libs/esl/fs_cli.c +++ b/libs/esl/fs_cli.c @@ -76,7 +76,7 @@ static int is_color = 1; static int warn_stop = 0; static int connected = 0; static int allow_ctl_c = 0; -static char bare_prompt_str[512] = ""; +static char bare_prompt_str[514] = ""; static int bare_prompt_str_len = 0; static char prompt_str[512] = ""; static char prompt_color[12] = {ESL_SEQ_DEFAULT_COLOR}; diff --git a/libs/freetdm/src/ftdm_io.c b/libs/freetdm/src/ftdm_io.c index c3570d780a..9adcd27509 100644 --- a/libs/freetdm/src/ftdm_io.c +++ b/libs/freetdm/src/ftdm_io.c @@ -3817,7 +3817,7 @@ FT_DECLARE(ftdm_status_t) ftdm_channel_queue_dtmf(ftdm_channel_t *ftdmchan, cons if (!ftdmchan->dtmfdbg.file) { struct tm currtime; time_t currsec; - char dfile[1024]; + char dfile[1138]; currsec = time(NULL); @@ -5636,7 +5636,7 @@ FT_DECLARE(ftdm_status_t) ftdm_unload_modules(void) { ftdm_hash_iterator_t *i = NULL; ftdm_dso_lib_t lib = NULL; - char modpath[255] = { 0 }; + char modpath[256] = { 0 }; /* stop signaling interfaces first as signaling depends on I/O and not the other way around */ for (i = hashtable_first(globals.module_hash); i; i = hashtable_next(i)) { diff --git a/src/mod/applications/mod_conference/mod_conference.h b/src/mod/applications/mod_conference/mod_conference.h index 8bbfae2b12..512ba843b7 100644 --- a/src/mod/applications/mod_conference/mod_conference.h +++ b/src/mod/applications/mod_conference/mod_conference.h @@ -350,7 +350,7 @@ typedef enum { EFLAG_HUP_MEMBER = (1 << 28), EFLAG_PLAY_FILE_DONE = (1 << 29), EFLAG_SET_POSITION_MEMBER = (1 << 30), - EFLAG_BLIND_MEMBER = (1 << 31) + EFLAG_BLIND_MEMBER = (int)(1U << 31U) } event_type_t; #ifdef OPENAL_POSITIONING 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 011166b270..f591855a3e 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 @@ -291,7 +291,11 @@ static void event_handler(switch_event_t *event) char *buf; #ifdef HAVE_OPENSSL int outlen, tmplen; +#if OPENSSL_VERSION_NUMBER >= 0x10100000 + EVP_CIPHER_CTX *ctx; +#else EVP_CIPHER_CTX ctx; +#endif char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; switch_uuid_t uuid; @@ -309,6 +313,19 @@ static void event_handler(switch_event_t *event) if (globals.psk) { switch_copy_string(buf, uuid_str, SWITCH_UUID_FORMATTED_LENGTH); +#if OPENSSL_VERSION_NUMBER >= 0x10100000 + ctx = EVP_CIPHER_CTX_new(); + EVP_EncryptInit(ctx, EVP_bf_cbc(), NULL, NULL); + EVP_CIPHER_CTX_set_key_length(ctx, strlen(globals.psk)); + EVP_EncryptInit(ctx, NULL, (unsigned char *) globals.psk, (unsigned char *) uuid_str); + EVP_EncryptUpdate(ctx, (unsigned char *) buf + SWITCH_UUID_FORMATTED_LENGTH, + &outlen, (unsigned char *) packet, (int) strlen(packet)); + EVP_EncryptUpdate(ctx, (unsigned char *) buf + SWITCH_UUID_FORMATTED_LENGTH + outlen, + &tmplen, (unsigned char *) MAGIC, (int) strlen((char *) MAGIC)); + outlen += tmplen; + EVP_EncryptFinal(ctx, (unsigned char *) buf + SWITCH_UUID_FORMATTED_LENGTH + outlen, &tmplen); + EVP_CIPHER_CTX_cleanup(ctx); +#else EVP_CIPHER_CTX_init(&ctx); EVP_EncryptInit(&ctx, EVP_bf_cbc(), NULL, NULL); EVP_CIPHER_CTX_set_key_length(&ctx, strlen(globals.psk)); @@ -320,6 +337,7 @@ static void event_handler(switch_event_t *event) outlen += tmplen; EVP_EncryptFinal(&ctx, (unsigned char *) buf + SWITCH_UUID_FORMATTED_LENGTH + outlen, &tmplen); EVP_CIPHER_CTX_cleanup(&ctx); +#endif outlen += tmplen; len = (size_t) outlen + SWITCH_UUID_FORMATTED_LENGTH; *(buf + SWITCH_UUID_FORMATTED_LENGTH + outlen) = '\0'; @@ -530,7 +548,11 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime) char uuid_str[SWITCH_UUID_FORMATTED_LENGTH + 1]; char *tmp; int outl, tmplen; +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + EVP_CIPHER_CTX *ctx; +#else EVP_CIPHER_CTX ctx; +#endif len -= SWITCH_UUID_FORMATTED_LENGTH; @@ -541,6 +563,15 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime) switch_copy_string(uuid_str, packet, SWITCH_UUID_FORMATTED_LENGTH); packet += SWITCH_UUID_FORMATTED_LENGTH; +#if OPENSSL_VERSION_NUMBER >= 0x10100000L + ctx = EVP_CIPHER_CTX_new(); + EVP_DecryptInit(ctx, EVP_bf_cbc(), NULL, NULL); + EVP_CIPHER_CTX_set_key_length(ctx, strlen(globals.psk)); + EVP_DecryptInit(ctx, NULL, (unsigned char *) globals.psk, (unsigned char *) uuid_str); + EVP_DecryptUpdate(ctx, (unsigned char *) tmp, &outl, (unsigned char *) packet, (int) len); + EVP_DecryptFinal(ctx, (unsigned char *) tmp + outl, &tmplen); + EVP_CIPHER_CTX_cleanup(ctx); +#else EVP_CIPHER_CTX_init(&ctx); EVP_DecryptInit(&ctx, EVP_bf_cbc(), NULL, NULL); EVP_CIPHER_CTX_set_key_length(&ctx, strlen(globals.psk)); @@ -548,6 +579,8 @@ SWITCH_MODULE_RUNTIME_FUNCTION(mod_event_multicast_runtime) EVP_DecryptUpdate(&ctx, (unsigned char *) tmp, &outl, (unsigned char *) packet, (int) len); EVP_DecryptFinal(&ctx, (unsigned char *) tmp + outl, &tmplen); EVP_CIPHER_CTX_cleanup(&ctx); +#endif + *(tmp + outl + tmplen) = '\0'; /*switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "decrypted event as %s\n----------\n of actual length %d (%d) %d\n", tmp, outl + tmplen, (int) len, (int) strlen(tmp)); */ diff --git a/src/switch_ivr_play_say.c b/src/switch_ivr_play_say.c index d4f0d46c80..6a9298d2d4 100644 --- a/src/switch_ivr_play_say.c +++ b/src/switch_ivr_play_say.c @@ -1665,7 +1665,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_play_file(switch_core_session_t *sess } } - buflen = FILE_STARTSAMPLES * sizeof(*abuf) * fh->cur_channels ? fh->cur_channels : fh->channels; + buflen = (FILE_STARTSAMPLES * sizeof(*abuf) * fh->cur_channels) > 0 ? fh->cur_channels : fh->channels; if (buflen > write_frame.buflen) { abuf = realloc(abuf, buflen);