cherry-pick.FILE5_30-22-ged0542b8.better-fix-for-previous.patch 620 B

1234567891011121314151617181920212223242526
  1. Subject: Better fix for previous
  2. Origin: FILE5_30-22-ged0542b8
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Fri Mar 17 23:56:16 2017 +0000
  5. [ refers to FILE5_30-19-g7605984c -CB ]
  6. --- a/src/cdf.c
  7. +++ b/src/cdf.c
  8. @@ -984,11 +984,14 @@
  9. {
  10. uint32_t l;
  11. - o4 += sizeof(uint32_t);
  12. - if (q + o >= e || q + o4 >= e)
  13. + if (q + o + sizeof(uint32_t) >= e)
  14. goto out;
  15. l = CDF_GETUINT32(q, o);
  16. + o4 += sizeof(uint32_t);
  17. + if (q + o4 + l >= e)
  18. + goto out;
  19. +
  20. inp[i].pi_str.s_len = l;
  21. inp[i].pi_str.s_buf = CAST(const char *,
  22. CAST(const void *, &q[o4]));