cherry-pick.FILE5_30-48-gaee11eef.fix-out-of-bounds-read-found-by-oss-fuzz.patch 492 B

12345678910111213141516
  1. Subject: Fix out of bounds read; found by oss-fuzz
  2. Origin: FILE5_30-48-gaee11eef
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Sat Apr 22 20:02:34 2017 +0000
  5. --- a/src/cdf.c
  6. +++ b/src/cdf.c
  7. @@ -961,7 +961,7 @@
  8. i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
  9. left = CAST(size_t, e - q);
  10. if (inp[i].pi_type & CDF_VECTOR) {
  11. - if (left < sizeof(uint32_t)) {
  12. + if (left < sizeof(uint32_t) * 2) {
  13. DPRINTF(("missing CDF_VECTOR length\n"));
  14. goto out;
  15. }