gd-CVE-2018-5711.patch 815 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. Index: libgd-2.2.5/src/gd_gif_in.c
  2. ===================================================================
  3. --- libgd-2.2.5.orig/src/gd_gif_in.c 2018-01-22 15:19:35.417382486 +0100
  4. +++ libgd-2.2.5/src/gd_gif_in.c 2018-01-22 15:21:28.683291084 +0100
  5. @@ -335,11 +335,6 @@ terminated:
  6. return 0;
  7. }
  8. - if(!im->colorsTotal) {
  9. - gdImageDestroy(im);
  10. - return 0;
  11. - }
  12. -
  13. /* Check for open colors at the end, so
  14. * we can reduce colorsTotal and ultimately
  15. * BitsPerPixel */
  16. @@ -351,6 +346,11 @@ terminated:
  17. }
  18. }
  19. + if(!im->colorsTotal) {
  20. + gdImageDestroy(im);
  21. + return 0;
  22. + }
  23. +
  24. return im;
  25. }
  26. @@ -447,7 +447,7 @@ static int
  27. GetCode_(gdIOCtx *fd, CODE_STATIC_DATA *scd, int code_size, int flag, int *ZeroDataBlockP)
  28. {
  29. int i, j, ret;
  30. - unsigned char count;
  31. + int count;
  32. if(flag) {
  33. scd->curbit = 0;