From 2505b45134f2a45403c41ff1a910f32061d1874e Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 22 Sep 2021 20:14:53 +0300 Subject: [PATCH] [mod_skinny, mod_cdr_mongodb, mod_rayo] Fix Debian 11 build warnings. --- src/mod/endpoints/mod_skinny/mod_skinny.c | 2 +- src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.c | 2 +- src/mod/event_handlers/mod_rayo/Makefile.am | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/mod/endpoints/mod_skinny/mod_skinny.c b/src/mod/endpoints/mod_skinny/mod_skinny.c index 0274912ad2..3df1290047 100644 --- a/src/mod/endpoints/mod_skinny/mod_skinny.c +++ b/src/mod/endpoints/mod_skinny/mod_skinny.c @@ -2414,7 +2414,7 @@ static switch_status_t load_skinny_config(void) char *val = (char *) switch_xml_attr_soft(param, "value"); if (!strcasecmp(var, "firmware-version")) { - strncpy(params->firmware_version, val, 16); + snprintf(params->firmware_version, 16, "%s", val); } } /* param */ switch_core_hash_insert(profile->device_type_params_hash, id_str, params); diff --git a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.c b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.c index 77870b3dc2..19110f2e66 100644 --- a/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.c +++ b/src/mod/event_handlers/mod_cdr_mongodb/driver/src/mongo.c @@ -438,7 +438,7 @@ static void mongo_replset_add_node( mongo_host_port **list, const char *host, in mongo_host_port *host_port = bson_malloc( sizeof( mongo_host_port ) ); host_port->port = port; host_port->next = NULL; - strncpy( host_port->host, host, sizeof(host_port->host) - 1 ); + snprintf(host_port->host, sizeof(host_port->host), "%s", host); if( *list == NULL ) *list = host_port; diff --git a/src/mod/event_handlers/mod_rayo/Makefile.am b/src/mod/event_handlers/mod_rayo/Makefile.am index f2b7178094..a9ca95d51b 100644 --- a/src/mod/event_handlers/mod_rayo/Makefile.am +++ b/src/mod/event_handlers/mod_rayo/Makefile.am @@ -27,17 +27,17 @@ noinst_PROGRAMS = test/test_iks test/test_nlsml test/test_srgs test_test_iks_SOURCES = test/test_iks.c test_test_iks_CFLAGS = $(AM_CFLAGS) -I. -I$(switch_builddir)/libs/iksemel/include $(PCRE_CFLAGS) -DSWITCH_TEST_BASE_DIR_FOR_CONF=\"${abs_builddir}/test\" -DSWITCH_TEST_BASE_DIR_OVERRIDE=\"${abs_builddir}/test\" test_test_iks_LDFLAGS = $(AM_LDFLAGS) -avoid-version -no-undefined $(freeswitch_LDFLAGS) $(switch_builddir)/libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) -test_test_iks_LDADD = librayomod.la $(IKS_LA) $(PCRE_LIBS) +test_test_iks_LDADD = librayomod.la $(IKS_LA) $(PCRE_LIBS) $(switch_builddir)/libfreeswitch.la test_test_nlsml_SOURCES = test/test_nlsml.c test_test_nlsml_CFLAGS = $(AM_CFLAGS) -I. -I$(switch_builddir)/libs/iksemel/include $(PCRE_CFLAGS) -DSWITCH_TEST_BASE_DIR_FOR_CONF=\"${abs_builddir}/test\" -DSWITCH_TEST_BASE_DIR_OVERRIDE=\"${abs_builddir}/test\" test_test_nlsml_LDFLAGS = $(AM_LDFLAGS) -avoid-version -no-undefined $(freeswitch_LDFLAGS) $(switch_builddir)/libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) -test_test_nlsml_LDADD = librayomod.la $(IKS_LA) $(PCRE_LIBS) +test_test_nlsml_LDADD = librayomod.la $(IKS_LA) $(PCRE_LIBS) $(switch_builddir)/libfreeswitch.la test_test_srgs_SOURCES = test/test_srgs.c test_test_srgs_CFLAGS = $(AM_CFLAGS) -I. -I$(switch_builddir)/libs/iksemel/include $(PCRE_CFLAGS) -DSWITCH_TEST_BASE_DIR_FOR_CONF=\"${abs_builddir}/test\" -DSWITCH_TEST_BASE_DIR_OVERRIDE=\"${abs_builddir}/test\" test_test_srgs_LDFLAGS = $(AM_LDFLAGS) -avoid-version -no-undefined $(freeswitch_LDFLAGS) $(switch_builddir)/libfreeswitch.la $(CORE_LIBS) $(APR_LIBS) -test_test_srgs_LDADD = librayomod.la $(IKS_LA) $(PCRE_LIBS) +test_test_srgs_LDADD = librayomod.la $(IKS_LA) $(PCRE_LIBS) $(switch_builddir)/libfreeswitch.la TESTS = $(noinst_PROGRAMS)