texlive-2009-CVE-2010-0739.patch 613 B

1234567891011121314151617
  1. Index: dospecial.c
  2. ===================================================================
  3. --- a/texk/dvipsk/dospecial.c (revision 17558)
  4. +++ b/texk/dvipsk/dospecial.c (revision 17569)
  5. @@ -297,6 +297,12 @@
  6. static int omega_specials = 0;
  7. if (nextstring + numbytes > maxstring) {
  8. + if (numbytes < 0
  9. + || (numbytes > 0 && 2 > INT_MAX / numbytes)
  10. + || 2 * numbytes > 1000 + 2 * numbytes) {
  11. + error("! Integer overflow in predospecial");
  12. + exit(1);
  13. + }
  14. p = nextstring = mymalloc(1000 + 2 * numbytes) ;
  15. maxstring = nextstring + 2 * numbytes + 700 ;
  16. }