lcms-1.19-cve_2013_4276-1.patch 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. Submitted By: Fernando de Oliveira <famobr at yahoo dot com dot br>
  2. Date: 2015-03-24
  3. Initial Package Version: 1.19
  4. Upstream Status: unknown
  5. Origin: Arch Linux
  6. URL (CVE): https://www.suse.com/security/cve/CVE-2013-4276.html
  7. Description: Multiple stack-based buffer overflows in LittleCMS
  8. (aka lcms or liblcms) 1.19 and earlier allow remote
  9. attackers to cause a denial of service (crash) via a
  10. crafted (1) ICC color profile to the icctrans utility
  11. or (2) TIFF image to the tiffdiff utility.
  12. diff -ur lcms-1.19.dfsg/samples/icctrans.c lcms-1.19.dfsg-patched/samples/icctrans.c
  13. --- lcms-1.19.dfsg/samples/icctrans.c 2009-10-30 15:57:45.000000000 +0000
  14. +++ lcms-1.19.dfsg-patched/samples/icctrans.c 2013-08-06 11:53:14.385266647 +0100
  15. @@ -86,6 +86,8 @@
  16. static LPcmsNAMEDCOLORLIST InputColorant = NULL;
  17. static LPcmsNAMEDCOLORLIST OutputColorant = NULL;
  18. +unsigned int Buffer_size = 4096;
  19. +
  20. // isatty replacement
  21. @@ -500,7 +502,7 @@
  22. Prefix[0] = 0;
  23. if (!lTerse)
  24. - sprintf(Prefix, "%s=", C);
  25. + snprintf(Prefix, 20, "%s=", C);
  26. if (InHexa)
  27. {
  28. @@ -648,7 +650,9 @@
  29. static
  30. void GetLine(char* Buffer)
  31. {
  32. - scanf("%s", Buffer);
  33. + char User_buffer[Buffer_size];
  34. + fgets(User_buffer, (Buffer_size - 1), stdin);
  35. + sscanf(User_buffer,"%s", Buffer);
  36. if (toupper(Buffer[0]) == 'Q') { // Quit?
  37. @@ -668,7 +672,7 @@
  38. static
  39. double GetAnswer(const char* Prompt, double Range)
  40. {
  41. - char Buffer[4096];
  42. + char Buffer[Buffer_size];
  43. double val = 0.0;
  44. if (Range == 0.0) { // Range 0 means double value
  45. @@ -738,7 +742,7 @@
  46. static
  47. WORD GetIndex(void)
  48. {
  49. - char Buffer[4096], Name[40], Prefix[40], Suffix[40];
  50. + char Buffer[Buffer_size], Name[40], Prefix[40], Suffix[40];
  51. int index, max;
  52. max = cmsNamedColorCount(hTrans)-1;
  53. diff -ur lcms-1.19.dfsg/tifficc/tiffdiff.c lcms-1.19.dfsg-patched/tifficc/tiffdiff.c
  54. --- lcms-1.19.dfsg/tifficc/tiffdiff.c 2009-10-30 15:57:46.000000000 +0000
  55. +++ lcms-1.19.dfsg-patched/tifficc/tiffdiff.c 2013-08-06 11:49:06.698951157 +0100
  56. @@ -633,7 +633,7 @@
  57. cmsIT8SetSheetType(hIT8, "TIFFDIFF");
  58. - sprintf(Buffer, "Differences between %s and %s", TiffName1, TiffName2);
  59. + snprintf(Buffer, 256, "Differences between %s and %s", TiffName1, TiffName2);
  60. cmsIT8SetComment(hIT8, Buffer);