[MERGED] osmo-bts[master]: DTX HR - fix array size calculation

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/.

Max gerrit-no-reply at lists.osmocom.org
Mon Oct 24 08:43:30 UTC 2016


Max has submitted this change and it was merged.

Change subject: DTX HR - fix array size calculation
......................................................................


DTX HR - fix array size calculation

Use ARRAY_SIZE macro for each pointer separately.
Fix suggested by Neels Hofmeyr <nhofmeyr at sysmocom.de>.

Change-Id: I68ec1be33fb743977121d654187d85d6b8451e2b
Fixes: Coverity CID 150132
---
M src/common/msg_utils.c
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/common/msg_utils.c b/src/common/msg_utils.c
index f00a71a..393ae90 100644
--- a/src/common/msg_utils.c
+++ b/src/common/msg_utils.c
@@ -260,7 +260,8 @@
 			return fn_chk(f, fn, ARRAY_SIZE(f));
 		else
 			return fn_chk(lchan->nr ? h1 : h0, fn,
-				      ARRAY_SIZE(lchan->nr ? h1 : h0));
+				      lchan->nr ? ARRAY_SIZE(h1) :
+				      ARRAY_SIZE(h0));
 	}
 	return false;
 }

-- 
To view, visit https://gerrit.osmocom.org/1063
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I68ec1be33fb743977121d654187d85d6b8451e2b
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: Max <msuraev at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Max <msuraev at sysmocom.de>



More information about the gerrit-log mailing list