17270639 problem in UTILITY/LCMS
authorStefan Teleman <stefan.teleman@oracle.com>
Fri, 16 Aug 2013 09:01:07 -0700
changeset 1443 7dbaf9c81b75
parent 1442 dfa14f95f572
child 1444 45cb7c6c7aa2
17270639 problem in UTILITY/LCMS 17271949 LCMS should deliver 64-bit executables
components/lcms/lcms.p5m
components/lcms/patches/005-icctrans.c.patch
components/lcms/patches/006-tiffdiff.c.patch
--- a/components/lcms/lcms.p5m	Thu Aug 15 13:38:30 2013 -0700
+++ b/components/lcms/lcms.p5m	Fri Aug 16 09:01:07 2013 -0700
@@ -37,13 +37,13 @@
 set name=org.opensolaris.consolidation value=$(CONSOLIDATION)
 #
 #
-file path=usr/bin/icc2ps
-file path=usr/bin/icclink
-file path=usr/bin/icctrans
-file path=usr/bin/jpegicc
-file path=usr/bin/tiffdiff
-file path=usr/bin/tifficc
-file path=usr/bin/wtpt
+file usr/bin/$(MACH64)/icc2ps path=usr/bin/icc2ps
+file usr/bin/$(MACH64)/icclink path=usr/bin/icclink
+file usr/bin/$(MACH64)/icctrans path=usr/bin/icctrans
+file usr/bin/$(MACH64)/jpegicc path=usr/bin/jpegicc
+file usr/bin/$(MACH64)/tiffdiff path=usr/bin/tiffdiff
+file usr/bin/$(MACH64)/tifficc path=usr/bin/tifficc
+file usr/bin/$(MACH64)/wtpt path=usr/bin/wtpt
 file path=usr/include/lcms/icc34.h
 file path=usr/include/lcms/lcms.h
 file path=usr/lib/$(MACH64)/liblcms.so.1.0.19
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/lcms/patches/005-icctrans.c.patch	Fri Aug 16 09:01:07 2013 -0700
@@ -0,0 +1,49 @@
+--- samples/icctrans.c	2009-10-30 15:57:45.000000000 +0000
++++ samples/icctrans.c	2013-08-06 11:53:14.385266647 +0100
[email protected]@ -86,6 +86,8 @@ 
+ static LPcmsNAMEDCOLORLIST InputColorant = NULL;
+ static LPcmsNAMEDCOLORLIST OutputColorant = NULL;
+ 
++#define Buffer_size 4096
++
+ 
+ // isatty replacement
+ 
[email protected]@ -500,7 +502,7 @@ 
+ 
+     Prefix[0] = 0;
+     if (!lTerse)
+-        sprintf(Prefix, "%s=", C);
++        snprintf(Prefix, 20, "%s=", C);
+ 
+     if (InHexa)
+     {
[email protected]@ -648,7 +650,9 @@ 
+ static
+ void GetLine(char* Buffer)
+ {    
+-    scanf("%s", Buffer);
++    char User_buffer[Buffer_size];
++    fgets(User_buffer, (Buffer_size - 1), stdin);
++    sscanf(User_buffer,"%s", Buffer);
+     
+     if (toupper(Buffer[0]) == 'Q') { // Quit?
+ 
[email protected]@ -668,7 +672,7 @@ 
+ static
+ double GetAnswer(const char* Prompt, double Range)
+ {
+-    char Buffer[4096];
++    char Buffer[Buffer_size];
+     double val = 0.0;
+ 	       
+     if (Range == 0.0) {              // Range 0 means double value
[email protected]@ -738,7 +742,7 @@ 
+ static
+ WORD GetIndex(void)
+ {
+-    char Buffer[4096], Name[40], Prefix[40], Suffix[40];
++    char Buffer[Buffer_size], Name[40], Prefix[40], Suffix[40];
+     int index, max;
+ 
+     max = cmsNamedColorCount(hTrans)-1;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/lcms/patches/006-tiffdiff.c.patch	Fri Aug 16 09:01:07 2013 -0700
@@ -0,0 +1,11 @@
+--- tifficc/tiffdiff.c	2009-10-30 08:57:46.000000000 -0700
++++ tifficc/tiffdiff.c	2013-08-05 16:21:59.504764730 -0700
[email protected]@ -633,7 +633,7 @@
+     cmsIT8SetSheetType(hIT8, "TIFFDIFF");
+     
+    
+-    sprintf(Buffer, "Differences between %s and %s", TiffName1, TiffName2);
++    snprintf(Buffer, sizeof(Buffer), "Differences between %s and %s", TiffName1, TiffName2);
+   
+     cmsIT8SetComment(hIT8, Buffer);
+