From a24be85dc41885ee77072af9f079c69c575061e9 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 9 Dec 2016 17:58:17 +0100 Subject: 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 --- tests/msgb/msgb_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tests/msgb') 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)) -- cgit v1.2.3