CVE-2014-3480.patch 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. Subject: The cdf_count_chain function does not properly validate sector-count data
  2. ID: CVE-2014-3480
  3. Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Wed Jun 4 17:23:19 2014 +0000
  5. Origin:
  6. commit 40bade80cbe2af1d0b2cd0420cebd5d5905a2382
  7. Debian-Author: Holger Levsen <holger@debian.org>
  8. Comment:
  9. made apply cleanly based on [origin]
  10. Reviewed-By: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
  11. Last-Update: 2014-09-07
  12. Fix incorrect bounds check for sector count. (Francisco Alonso and Jan Kaluza
  13. at RedHat)
  14. --- a/src/cdf.c
  15. +++ b/src/cdf.c
  16. @@ -460,7 +460,8 @@
  17. cdf_count_chain(const cdf_sat_t *sat, cdf_secid_t sid, size_t size)
  18. {
  19. size_t i, j;
  20. - cdf_secid_t maxsector = (cdf_secid_t)(sat->sat_len * size);
  21. + cdf_secid_t maxsector = (cdf_secid_t)((sat->sat_len * size)
  22. + / sizeof(maxsector));
  23. DPRINTF(("Chain:"));
  24. for (j = i = 0; sid >= 0; i++, j++) {
  25. @@ -470,8 +471,8 @@
  26. errno = EFTYPE;
  27. return (size_t)-1;
  28. }
  29. - if (sid > maxsector) {
  30. - DPRINTF(("Sector %d > %d\n", sid, maxsector));
  31. + if (sid >= maxsector) {
  32. + DPRINTF(("Sector %d >= %d\n", sid, maxsector));
  33. errno = EFTYPE;
  34. return (size_t)-1;
  35. }