CVE-2014-0238.patch 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. Subject: The cdf_read_property_info function allows remote attackers to cause a denial of service
  2. ID: CVE-2014-0238
  3. Author: Christos Zoulas <christos@zoulas.com>
  4. Date: Wed May 21 13:04:38 2014 +0000
  5. Origin:
  6. commit f97486ef5dc3e8735440edc4fc8808c63e1a3ef0
  7. Debian-Author: Holger Levsen <holger@debian.org>
  8. Comment:
  9. made apply cleanly based on [origin]
  10. Comment-2: Upstream's commit message refers to a different CVE ID
  11. Reviewed-By: Christoph Biedl <debian.axhn@manchmal.in-ulm.de>
  12. Last-Update: 2014-09-07
  13. CVE-2014-0207: Prevent 0 element vectors and vectors longer than the number
  14. of properties from accessing random memory.
  15. --- a/src/cdf.c
  16. +++ b/src/cdf.c
  17. @@ -813,6 +813,10 @@
  18. i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
  19. if (inp[i].pi_type & CDF_VECTOR) {
  20. nelements = CDF_GETUINT32(q, 1);
  21. + if (nelements == 0) {
  22. + DPRINTF(("CDF_VECTOR with nelements == 0\n"));
  23. + goto out;
  24. + }
  25. o = 2;
  26. } else {
  27. nelements = 1;
  28. @@ -887,7 +891,9 @@
  29. }
  30. DPRINTF(("nelements = %" SIZE_T_FORMAT "u\n",
  31. nelements));
  32. - for (j = 0; j < nelements; j++, i++) {
  33. + for (j = 0; j < nelements && i < sh.sh_properties;
  34. + j++, i++)
  35. + {
  36. uint32_t l = CDF_GETUINT32(q, o);
  37. inp[i].pi_str.s_len = l;
  38. inp[i].pi_str.s_buf = (const char *)