aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests
diff options
context:
space:
mode:
authorPhilipp <pmaier@sysmocom.de>2016-09-28 15:10:14 +0200
committerHarald Welte <laforge@gnumonks.org>2016-10-28 13:43:10 +0000
commitae9beda1506ab06d898a4ec26bfd53d8fc211614 (patch)
treeecb9c91ca5aaedbd1cd57092697bc3738bbc3b16 /openbsc/tests
parent1b76a03cddcfb52c1ebd5a6f0d990128058a516c (diff)
sndcp: Fixups for sndcp layer based on coverity-scan suggestions
- missing break in gprs_sndcp_pcomp.c, line 143 - string overflow in slhc_test.c, line 211 - sizeof mismatch in gprs_sndcp_xid.c, line 1369 and 1378 - mismatching signedness in gprs_sndcp_xid.c, line 1377 - needless < 0 comparison in gprs_sndcp_xid.c, line 477 - needless < 0 comparison in gprs_sndcp_xid.c, line 209 - missing returncode check in v42bis_test.c, line 320 - wrong pointer dereferentialization in gprs_sndcp_comp.c, line 73 Change-Id: I4f9adf251f5119e67ffe76baad6f1f996ac8dbad
Diffstat (limited to 'openbsc/tests')
-rw-r--r--openbsc/tests/slhc/slhc_test.c2
-rw-r--r--openbsc/tests/v42bis/v42bis_test.c1
2 files changed, 3 insertions, 0 deletions
diff --git a/openbsc/tests/slhc/slhc_test.c b/openbsc/tests/slhc/slhc_test.c
index e8ea02f75..d2e1cd9dc 100644
--- a/openbsc/tests/slhc/slhc_test.c
+++ b/openbsc/tests/slhc/slhc_test.c
@@ -182,6 +182,8 @@ static void test_slhc(const void *ctx)
memset(packet, 0, sizeof(packet));
memset(packet_compr, 0, sizeof(packet_compr));
memset(packet_decompr, 0, sizeof(packet_decompr));
+
+ OSMO_ASSERT(strlen(packets[i]) < sizeof(packet_ascii));
strcpy(packet_ascii, packets[i]);
packet_len =
diff --git a/openbsc/tests/v42bis/v42bis_test.c b/openbsc/tests/v42bis/v42bis_test.c
index 4e055148e..7e907858d 100644
--- a/openbsc/tests/v42bis/v42bis_test.c
+++ b/openbsc/tests/v42bis/v42bis_test.c
@@ -318,6 +318,7 @@ static void test_v42bis_tcpip(const void *ctx, int packet_id)
len = strlen(uncompr_packets[packet_id]);
testvec = talloc_zero_size(ctx, len);
len = osmo_hexparse(uncompr_packets[packet_id], testvec, len);
+ OSMO_ASSERT(len > 0);
v42bis(ctx, V42BIS_COMPRESSION_MODE_DYNAMIC, testvec, len);
v42bis(ctx, V42BIS_COMPRESSION_MODE_ALWAYS, testvec, len);
v42bis(ctx, V42BIS_COMPRESSION_MODE_NEVER, testvec, len);