cherry-pick.FILE5_33-34-g72e9a7fe.pr-6-tobias-out-of-boundary-read-in-der-parser.patch 478 B

12345678910111213141516
  1. Subject: PR/6: tobias: out of boundary read in DER parser
  2. Origin: FILE5_33-34-g72e9a7fe <https://github.com/file/file/commit/FILE5_33-34-g72e9a7fe>
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Sat Jun 23 15:15:26 2018 +0000
  5. --- a/src/der.c
  6. +++ b/src/der.c
  7. @@ -199,7 +199,7 @@
  8. for (i = 0; i < digits; i++)
  9. len = (len << 8) | c[(*p)++];
  10. - if (*p + len >= l)
  11. + if (len > UINT32_MAX - *p || *p + len >= l)
  12. return DER_BAD;
  13. return CAST(uint32_t, len);
  14. }