aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-11-25 23:52:46 +0100
committerHarald Welte <laforge@gnumonks.org>2016-11-26 16:08:37 +0000
commit7b6bae65847e5ff6b695054fddca3080fc9d3d99 (patch)
treed722479fe0dcba7f7079a1fc42b13e92025ceaa3 /openbsc
parent28f637ec2ca556896fce345f6dcb9b871a5ada53 (diff)
abis_nm: Fix possible not-null-terminated buffer
Unrealistic case with file name of 4096 bytes length. Change-Id: I503200b879b854cf2dc218d5fe3059a555732d92 Fixes: Coverity CID 57619
Diffstat (limited to 'openbsc')
-rw-r--r--openbsc/src/libbsc/abis_nm.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/openbsc/src/libbsc/abis_nm.c b/openbsc/src/libbsc/abis_nm.c
index 3289b3c52..fb6a9572e 100644
--- a/openbsc/src/libbsc/abis_nm.c
+++ b/openbsc/src/libbsc/abis_nm.c
@@ -2305,6 +2305,7 @@ int abis_nm_bs11_load_swl(struct gsm_bts *bts, const char *fname,
bs11_sw->forced = forced;
strncpy(bs11_sw->swl_fname, fname, sizeof(bs11_sw->swl_fname));
+ bs11_sw->swl_fname[sizeof(bs11_sw->swl_fname)-1] = '\0';
rc = bs11_read_swl_file(bs11_sw);
if (rc < 0)
return rc;