libosmocore/tests/tlv
Harald Welte 96c61074f5 tlv_parser: Fix various out-of-bounds accesses
The libosmocore TLV parser had a number of insufficient bounds checks
leading to reads beyond the end of the respective input buffer.

This patch
* adds proper out-of-bounds checks to all TLV types
* simplifies some of the existing checks
* introduces test cases to test all the corner cases
  where either TAG, or length, or value are not fully contained
  in the input buffer.

Thanks to Ilja Van Sprundel for reporting these problems.

Change-Id: I98b02c914c9e3ecf56050af846292aa6979d7508
2021-01-12 23:24:12 +01:00
..
tlv_test.c tlv_parser: Fix various out-of-bounds accesses 2021-01-12 23:24:12 +01:00
tlv_test.ok tlv_parser: Fix various out-of-bounds accesses 2021-01-12 23:24:12 +01:00