This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
Harald Welte gerrit-no-reply at lists.osmocom.orgHarald Welte has submitted this change and it was merged.
Change subject: sccp_test: sanitize: don't memcmp NULL pointers
......................................................................
sccp_test: sanitize: don't memcmp NULL pointers
Change-Id: I0159a875c1e11f4f9728d9e09f5c365b8174673a
---
M tests/sccp/sccp_test.c
1 file changed, 6 insertions(+), 4 deletions(-)
Approvals:
Harald Welte: Looks good to me, approved
Jenkins Builder: Verified
diff --git a/tests/sccp/sccp_test.c b/tests/sccp/sccp_test.c
index d6abc5d..ed485bc 100644
--- a/tests/sccp/sccp_test.c
+++ b/tests/sccp/sccp_test.c
@@ -886,15 +886,17 @@
FAIL("GTI length is wrong: %d\n", result.called.gti_len);
}
- if (memcmp(&parse_result[current_test].dst_gti_data[0],
- result.called.gti_data, result.called.gti_len) != 0) {
+ if (parse_result[current_test].dst_gti_data
+ && memcmp(&parse_result[current_test].dst_gti_data[0],
+ result.called.gti_data, result.called.gti_len) != 0) {
FAIL("GTI data is wrong: %d '%s'\n",
result.called.gti_len,
osmo_hexdump(result.called.gti_data, result.called.gti_len));
}
- if (memcmp(&parse_result[current_test].src_gti_data[0],
- result.calling.gti_data, result.calling.gti_len) != 0) {
+ if (parse_result[current_test].src_gti_data
+ && memcmp(&parse_result[current_test].src_gti_data[0],
+ result.calling.gti_data, result.calling.gti_len) != 0) {
FAIL("GTI data is wrong: %d\n", result.calling.gti_len);
}
}
--
To view, visit https://gerrit.osmocom.org/4881
To unsubscribe, visit https://gerrit.osmocom.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I0159a875c1e11f4f9728d9e09f5c365b8174673a
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder