aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/mgcp
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2017-01-13 03:10:54 +0100
committerHarald Welte <laforge@gnumonks.org>2017-01-23 11:59:01 +0000
commit59504dc80fe8c0d9a18994d82586a550c7efa341 (patch)
tree23f3f7906ad01337c44d862b929aed0257d55228 /openbsc/tests/mgcp
parentf5e74b5988cb6fb34a71188e70adc7b6c7fea28b (diff)
fix strncpy() invocation in vty_interface_layer3.c and 3 tests
Use osmo_strlcpy() to fix unsafe invocation of strncpy(), which potentially left the result unterminated. Change-Id: I1a119b1760a3e3262538b4b012d476fdce505482
Diffstat (limited to 'openbsc/tests/mgcp')
-rw-r--r--openbsc/tests/mgcp/mgcp_test.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/openbsc/tests/mgcp/mgcp_test.c b/openbsc/tests/mgcp/mgcp_test.c
index e2dc8fa37..b2d237ef5 100644
--- a/openbsc/tests/mgcp/mgcp_test.c
+++ b/openbsc/tests/mgcp/mgcp_test.c
@@ -25,6 +25,7 @@
#include <osmocom/core/application.h>
#include <osmocom/core/talloc.h>
+#include <osmocom/core/utils.h>
#include <string.h>
#include <limits.h>
#include <dlfcn.h>
@@ -54,7 +55,7 @@ static void test_strline(void)
char buf[2048];
int counter = 0;
- strncpy(buf, strline_test_data, sizeof(buf));
+ osmo_strlcpy(buf, strline_test_data, sizeof(buf));
for (line = strline_r(buf, &save); line;
line = strline_r(NULL, &save)) {