fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-hnbgw/+/28837 )
Change subject: tests/ranap_rab_ass: fix NULL pointer dereference
......................................................................
tests/ranap_rab_ass: fix NULL pointer dereference
Change-Id: I16fea7b2a8cb1d693e01c91d7633550e2e599ceb
Related: CID#275345
---
M tests/ranap_rab_ass/ranap_rab_ass_test.c
1 file changed, 5 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/37/28837/1
diff --git a/tests/ranap_rab_ass/ranap_rab_ass_test.c
b/tests/ranap_rab_ass/ranap_rab_ass_test.c
index 043b16b..4a4f7b2 100644
--- a/tests/ranap_rab_ass/ranap_rab_ass_test.c
+++ b/tests/ranap_rab_ass/ranap_rab_ass_test.c
@@ -64,9 +64,11 @@
printf("ranap_rab_ass_req_encode %s\n", encoded ? "ok" :
"ERROR");
printf("INPUT: %s\n", osmo_hexdump_nospc(testvec, sizeof(testvec)));
- printf("RESULT: %s\n", osmo_hexdump_nospc(encoded->data,
encoded->len));
- OSMO_ASSERT(encoded->len == sizeof(testvec));
- OSMO_ASSERT(memcmp(testvec, encoded->data, sizeof(testvec)) == 0);
+ if (encoded != NULL) {
+ printf("RESULT: %s\n", osmo_hexdump_nospc(encoded->data,
encoded->len));
+ OSMO_ASSERT(encoded->len == sizeof(testvec));
+ OSMO_ASSERT(memcmp(testvec, encoded->data, sizeof(testvec)) == 0);
+ }
ranap_ran_rx_co_free(&message);
msgb_free(encoded);
--
To view, visit
https://gerrit.osmocom.org/c/osmo-hnbgw/+/28837
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I16fea7b2a8cb1d693e01c91d7633550e2e599ceb
Gerrit-Change-Number: 28837
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de>
Gerrit-MessageType: newchange