include/osmo-bts/l1sap.h/L1SAP_FN2CCCHBLOCK: possible overflow
Have a look at the:
#define L1SAP_FN2CCCHBLOCK(fn) ((fn % 51) / 5 - 1)
if (fn < 5), we may get (0 / 5 - 1) (0 - 1) -1.
Is this expected?
well, (fn%51) < 6 doesn't occur on the CCCH, but only on the BCCH. So if somebody is using this macro from a non-CCCH context, then that's a bug. We could add an OSMO_ASSERT(fn >= 6) to be sure.
(fn%51) 5 is also illegal in this context, even though it renders a result. (fn%51)6 is the first burst of B0 on CCCH.