pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/30223 )
Change subject: amr: Guard against incorrect AMR FT passed to osmo_amr_{bits,bytes}() ......................................................................
amr: Guard against incorrect AMR FT passed to osmo_amr_{bits,bytes}()
Fixes: Coverity CID#283433 Change-Id: Ib11d4b64c6df19a85c4374fde89e1b56f410e438 --- M src/amr.c 1 file changed, 4 insertions(+), 0 deletions(-)
Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved fixeria: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve msuraev: Looks good to me, but someone else must approve
diff --git a/src/amr.c b/src/amr.c index 6ed5b6c..1b750eb 100644 --- a/src/amr.c +++ b/src/amr.c @@ -14,6 +14,8 @@ #include <unistd.h> #include <string.h> #include <stdbool.h> + +#include <osmocom/core/utils.h> #include <osmocom/netif/amr.h>
/* According to TS 26.101: @@ -56,11 +58,13 @@
size_t osmo_amr_bits(uint8_t amr_ft) { + OSMO_ASSERT(amr_ft < AMR_FT_MAX); return amr_ft_to_bits[amr_ft]; }
size_t osmo_amr_bytes(uint8_t amr_ft) { + OSMO_ASSERT(amr_ft < AMR_FT_MAX); return amr_ft_to_bytes[amr_ft]; }
3 is the latest approved patch-set. No files were changed between the latest approved patch-set and the submitted one.