pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-netif/+/30756 )

Change subject: amr: osmo_amr_bwe_to_oa(): validate input data is long enough
......................................................................

amr: osmo_amr_bwe_to_oa(): validate input data is long enough

Change-Id: I2d11ce71c29ae046c2feab1e59045d97dc3e5099
---
M src/amr.c
1 file changed, 2 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved



diff --git a/src/amr.c b/src/amr.c
index 81bcd08..f201e8a 100644
--- a/src/amr.c
+++ b/src/amr.c
@@ -221,6 +221,8 @@
        ft = (bwe_hdr->ft_hi << 1) | bwe_hdr->ft_lo;
        if (!osmo_amr_ft_valid(ft))
                return -1;
+       if (OSMO_BYTES_FOR_BITS(AMR_HDR_BWE_LEN_BITS + osmo_amr_bits(ft)) > 
payload_len)
+               return -1;

        memset(buf, 0, sizeof(buf));
        oa_hdr = (struct amr_hdr *)buf;

--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/30756
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I2d11ce71c29ae046c2feab1e59045d97dc3e5099
Gerrit-Change-Number: 30756
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to