cherry-pick.FILE5_30-47-gdc067431.fix-continuation-level-handling.patch 673 B

123456789101112131415161718192021222324252627
  1. Subject: [ Fix continuation level handling ]
  2. Origin: FILE5_30-47-gdc067431
  3. Upstream-Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Fri Apr 21 16:54:57 2017 +0000
  5. - if we failed to get the offset at the current continuation level, reduce it
  6. - reset continuation level on flush
  7. Found by oss-fuzz
  8. --- a/src/softmagic.c
  9. +++ b/src/softmagic.c
  10. @@ -192,6 +192,7 @@
  11. while (magindex < nmagic - 1 &&
  12. magic[magindex + 1].cont_level != 0)
  13. magindex++;
  14. + cont_level = 0;
  15. continue; /* Skip to next top-level test*/
  16. }
  17. @@ -370,6 +371,7 @@
  18. case -1:
  19. case 0:
  20. flush = 1;
  21. + cont_level--;
  22. break;
  23. default:
  24. break;