From ae15a2cac1a01e98e34b4ccd8932ae8f1b99186c Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Tue, 6 Aug 2013 14:29:14 +0200 Subject: vty: Fix misusage of snprintf in vty/utils.c Compiled with ubuntu 1204 (precise), where -Wformat-security is enabled by -Wall. Test yields ok, but the current implementation doesn't properly support multi-character separators and end strings. So the test output is truncated. Addresses: utils.c: In function 'vty_cmd_string_from_valstr': utils.c:84:2: warning: format not a string literal and no format arguments [-Wformat-security] utils.c:84:2: warning: format not a string literal and no format arguments [-Wformat-security] utils.c:108:2: warning: format not a string literal and no format arguments [-Wformat-security] utils.c:108:2: warning: format not a string literal and no format arguments [-Wformat-security] --- tests/Makefile.am | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'tests/Makefile.am') diff --git a/tests/Makefile.am b/tests/Makefile.am index e5fc7183..ecb2b6c5 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -5,7 +5,8 @@ check_PROGRAMS = timer/timer_test sms/sms_test ussd/ussd_test \ conv/conv_test auth/milenage_test lapd/lapd_test \ gsm0808/gsm0808_test gsm0408/gsm0408_test \ gb/bssgp_fc_test logging/logging_test fr/fr_test \ - loggingrb/loggingrb_test strrb/strrb_test + loggingrb/loggingrb_test strrb/strrb_test \ + vty/vty_test if ENABLE_MSGFILE check_PROGRAMS += msgfile/msgfile_test @@ -62,6 +63,9 @@ loggingrb_loggingrb_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_buildd strrb_strrb_test_SOURCES = strrb/strrb_test.c strrb_strrb_test_LDADD = $(top_builddir)/src/libosmocore.la +vty_vty_test_SOURCES = vty/vty_test.c +vty_vty_test_LDADD = $(top_builddir)/src/vty/libosmovty.la $(top_builddir)/src/libosmocore.la + # The `:;' works around a Bash 3.2 bug when the output is not writeable. $(srcdir)/package.m4: $(top_srcdir)/configure.ac @@ -91,7 +95,8 @@ EXTRA_DIST = testsuite.at $(srcdir)/package.m4 $(TESTSUITE) \ msgfile/msgfile_test.ok msgfile/msgconfig.cfg \ logging/logging_test.ok logging/logging_test.err \ fr/fr_test.ok loggingrb/logging_test.ok \ - loggingrb/logging_test.err strrb/strrb_test.ok + loggingrb/logging_test.err strrb/strrb_test.ok \ + vty/vty_test.ok DISTCLEANFILES = atconfig -- cgit v1.2.3