summaryrefslogtreecommitdiffstats
path: root/tests/msgb
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-12-09 17:58:17 +0100
committerHarald Welte <laforge@gnumonks.org>2016-12-09 17:59:58 +0100
commita24be85dc41885ee77072af9f079c69c575061e9 (patch)
tree2c1591987d0e7f08e81412bd1ae9548bcb822445 /tests/msgb
parent665d48bf15602e8666b292dbe66881786af2ea95 (diff)
Fix msgb_test on 64 bit architectures
truncating the unsigned long pointer msg->data to 'int' and then passin git into msgb_resize_area() is unsafe as depending on the 32rd address bit it will be eiether negative or positive. That will in turn change the expected "Sub area is not fully contained in the msg data\n" error message into "Negative sizes are not allowed\n" which is not what the autotest case expects. Change-Id: I87ce13c265704d4ba8724e7dc7ed874c1128e0fa
Diffstat (limited to 'tests/msgb')
-rw-r--r--tests/msgb/msgb_test.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/msgb/msgb_test.c b/tests/msgb/msgb_test.c
index a726ef4d..ac103829 100644
--- a/tests/msgb/msgb_test.c
+++ b/tests/msgb/msgb_test.c
@@ -195,7 +195,7 @@ static void test_msgb_resize_area()
OSMO_ASSERT(e != 0);
if (OSMO_PANIC_TRY(&e))
- msgb_resize_area(msg, NULL, (int)msg->data, 0);
+ msgb_resize_area(msg, NULL, 0, 0);
OSMO_ASSERT(e != 0);
if (OSMO_PANIC_TRY(&e))