From 6799c38eafa4c8138a0bf6e9f0d3390ec412c5df Mon Sep 17 00:00:00 2001 From: Pau Espin Pedrol Date: Mon, 17 Sep 2018 13:31:30 +0200 Subject: mgcp: Fix (again) osmux_cid_bitmap static array size calculation A previous commit merged today fixed array size boundary (multiple of 8 bits), but removed a required +1 which should be kept on top, because OSMUX_CID_MAX specified the maximum number used by a CID, that is (0,OSMUX_CID_MAX), and as a result we require OSMUX_CID_MAX+1 slots. Fixes: 65f422ad5878165be0a1eb05605aa3099536f0c8 Change-Id: I182c9c1a6dd28a4c5c0d8107d53852cf47541592 --- openbsc/src/libmgcp/mgcp_osmux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openbsc/src/libmgcp/mgcp_osmux.c b/openbsc/src/libmgcp/mgcp_osmux.c index ca0ed30e3..a4b7e7a87 100644 --- a/openbsc/src/libmgcp/mgcp_osmux.c +++ b/openbsc/src/libmgcp/mgcp_osmux.c @@ -544,8 +544,8 @@ int osmux_send_dummy(struct mgcp_endpoint *endp) htons(endp->cfg->osmux_port), buf, sizeof(buf)); } -/* bsc-nat allocates/releases the Osmux circuit ID */ -static uint8_t osmux_cid_bitmap[(OSMUX_CID_MAX + 7) / 8]; +/* bsc-nat allocates/releases the Osmux circuit ID. +7 to round up to 8 bit boundary. */ +static uint8_t osmux_cid_bitmap[(OSMUX_CID_MAX + 1 + 7) / 8]; int osmux_used_cid(void) { -- cgit v1.2.3