CVE-2015-8865.6713ca4.patch 839 B

123456789101112131415161718192021222324
  1. Subject: Buffer over-write in finfo_open with malformed magic file
  2. ID: CVE-2015-8865
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Author: Christos Zoulas <christos@zoulas.com>
  5. Date: Wed Jun 3 18:01:20 2015 +0000
  6. Origin: FILE5_22-75-g6713ca4
  7. Origin: https://bugs.php.net/bug.php?id=71527 (Original bug report)
  8. Origin: http://bugs.gw.com/view.php?id=522 (bug report for file)
  9. [ Original description: ]
  10. PR/454: Fix memory corruption when the continuation level jumps by more than
  11. 20 in a single step.
  12. --- a/src/funcs.c
  13. +++ b/src/funcs.c
  14. @@ -401,7 +401,7 @@
  15. size_t len;
  16. if (level >= ms->c.len) {
  17. - len = (ms->c.len += 20) * sizeof(*ms->c.li);
  18. + len = (ms->c.len = 20 + level) * sizeof(*ms->c.li);
  19. ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
  20. malloc(len) :
  21. realloc(ms->c.li, len));