[SCM] polsarpro branch, master, updated. upstream/4.2.0+dfsg-27-ga51075e

Antonio Valentino antonio.valentino at tiscali.it
Sun Mar 10 17:53:19 UTC 2013


The following commit has been merged in the master branch:
commit cdfdbd43c883f05396565e522ece39c56d4aaec0
Author: Antonio Valentino <antonio.valentino at tiscali.it>
Date:   Sat Mar 9 20:40:45 2013 +0000

    New patch: fix build problems with hardening flags

diff --git a/debian/patches/hardening.patch b/debian/patches/hardening.patch
new file mode 100644
index 0000000..81d2386
--- /dev/null
+++ b/debian/patches/hardening.patch
@@ -0,0 +1,434 @@
+Fix issues that break building with hardening flags enabled
+--- a/Soft/data_process_dual/supervised_classifier_S2.c
++++ b/Soft/data_process_dual/supervised_classifier_S2.c
+@@ -256,7 +256,7 @@
+ 	    edit_error("Could not open input file : ", file_name);
+     }
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_dual/supervised_classifier_T6.c
++++ b/Soft/data_process_dual/supervised_classifier_T6.c
+@@ -260,7 +260,7 @@
+   }
+  } 
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_dual/training_set_sampler_S2.c
++++ b/Soft/data_process_dual/training_set_sampler_S2.c
+@@ -497,7 +497,7 @@
+     }				/* Class */
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
+--- a/Soft/data_process_dual/training_set_sampler_T6.c
++++ b/Soft/data_process_dual/training_set_sampler_T6.c
+@@ -412,7 +412,7 @@
+     }				/* Class */
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
+--- a/Soft/data_process_dual/wishart_opt_coh_classifier_S2.c
++++ b/Soft/data_process_dual/wishart_opt_coh_classifier_S2.c
+@@ -224,7 +224,7 @@
+  if ((fich_mask=fopen(nom_fich, "rb"))==NULL)
+ 	edit_error("Could not open input file : ", nom_fich);
+ 
+- sprintf(nom_fich,class_file_name);
++ sprintf(nom_fich, "%s", class_file_name);
+  if ((fich_classe_in=fopen(nom_fich,"rb"))==NULL)
+ 	edit_error("Could not open input file : ", nom_fich);
+  
+--- a/Soft/data_process_dual/wishart_opt_coh_classifier_T6.c
++++ b/Soft/data_process_dual/wishart_opt_coh_classifier_T6.c
+@@ -219,7 +219,7 @@
+  if ((fich_mask=fopen(nom_fich, "rb"))==NULL)
+ 	edit_error("Could not open input file : ", nom_fich);
+ 
+- sprintf(nom_fich,class_file_name);
++ sprintf(nom_fich, "%s", class_file_name);
+  if ((fich_classe_in=fopen(nom_fich,"rb"))==NULL)
+ 	edit_error("Could not open input file : ", nom_fich);
+  
+--- a/Soft/data_process_sngl/training_set_sampler_T4.c
++++ b/Soft/data_process_sngl/training_set_sampler_T4.c
+@@ -426,7 +426,7 @@
+     }				/* Class */
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
+--- a/Soft/tools/create_mask_file.c
++++ b/Soft/tools/create_mask_file.c
+@@ -192,7 +192,7 @@
+ 		}/* Class */
+ 
+     if (border_error_flag == 0)  {
+-		sprintf(file_name, mask_file);
++		sprintf(file_name, "%s", mask_file);
+ 		if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 			edit_error("Could not open output file : ", file_name);
+ 	    for (lig = 0; lig < Nlig; lig++) fwrite(&im[lig][0], sizeof(float), Ncol, trn_file);
+--- a/Soft/tools/create_mask_roi_file.c
++++ b/Soft/tools/create_mask_roi_file.c
+@@ -192,13 +192,13 @@
+ 		}/* Class */
+ 
+     if (border_error_flag == 0)  {
+-		sprintf(file_name, mask_file_bin);
++		sprintf(file_name, "%s", mask_file_bin);
+ 		if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 			edit_error("Could not open output file : ", file_name);
+ 	    for (lig = 0; lig < Sub_Nlig; lig++) fwrite(&im[lig][0], sizeof(float), Sub_Ncol, trn_file);
+ 		fclose(trn_file);
+ 		
+-		sprintf(file_name, mask_file_txt);
++		sprintf(file_name, "%s", mask_file_txt);
+ 		if ((trn_file = fopen(file_name, "w")) == NULL)
+ 			edit_error("Could not open output file : ", file_name);
+ 			fprintf(trn_file,"%i\n",Off_lig);
+--- a/Soft/data_process_sngl/supervised_classifier_C4.c
++++ b/Soft/data_process_sngl/supervised_classifier_C4.c
+@@ -267,7 +267,7 @@
+ 	    edit_error("Could not open input file : ", file_name);
+     }
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/training_set_sampler_S2b.c
++++ b/Soft/data_process_sngl/training_set_sampler_S2b.c
+@@ -466,7 +466,7 @@
+     }				/* Class */
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/stat_extract_T3.c
++++ b/Soft/data_process_sngl/stat_extract_T3.c
+@@ -220,7 +220,7 @@
+       }
+    if (strcmp(Operation, "stat") == 0) {
+ 
+-sprintf(file_name, statisticsbin);
++sprintf(file_name, "%s", statisticsbin);
+ if ((statbin_file = fopen(file_name, "wb")) == NULL) edit_error("Could not open output file : ", file_name);
+ 
+ /* Training Area coordinates reading */
+@@ -288,7 +288,7 @@
+ 
+ if (border_error_flag == 0)
+     {
+-    sprintf(file_name, statresultstxt);
++    sprintf(file_name, "%s", statresultstxt);
+     if ((statres_file = fopen(file_name, "w")) == NULL) edit_error("Could not open output file : ", file_name);
+     fprintf(statres_file,"%i\n",cpt_zones[0]);
+     fprintf(statres_file,"1\n");
+--- a/Soft/data_process_sngl/supervised_classifier_T4.c
++++ b/Soft/data_process_sngl/supervised_classifier_T4.c
+@@ -270,7 +270,7 @@
+ 	    edit_error("Could not open input file : ", file_name);
+     }
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/stat_extract_T4.c
++++ b/Soft/data_process_sngl/stat_extract_T4.c
+@@ -239,7 +239,7 @@
+       }
+    if (strcmp(Operation, "stat") == 0) {
+ 
+-sprintf(file_name, statisticsbin);
++sprintf(file_name, "%s", statisticsbin);
+ if ((statbin_file = fopen(file_name, "wb")) == NULL) edit_error("Could not open output file : ", file_name);
+ 
+ /* Training Area coordinates reading */
+@@ -307,7 +307,7 @@
+ 
+ if (border_error_flag == 0)
+     {
+-    sprintf(file_name, statresultstxt);
++    sprintf(file_name, "%s", statresultstxt);
+     if ((statres_file = fopen(file_name, "w")) == NULL) edit_error("Could not open output file : ", file_name);
+     fprintf(statres_file,"%i\n",cpt_zones[0]);
+     fprintf(statres_file,"1\n");
+--- a/Soft/data_process_sngl/training_set_sampler_C3.c
++++ b/Soft/data_process_sngl/training_set_sampler_C3.c
+@@ -410,7 +410,7 @@
+     }				/* Class */
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/stat_extract_C4.c
++++ b/Soft/data_process_sngl/stat_extract_C4.c
+@@ -238,7 +238,7 @@
+       }
+    if (strcmp(Operation, "stat") == 0) {
+ 
+-sprintf(file_name, statisticsbin);
++sprintf(file_name, "%s", statisticsbin);
+ if ((statbin_file = fopen(file_name, "wb")) == NULL) edit_error("Could not open output file : ", file_name);
+ 
+ /* Training Area coordinates reading */
+@@ -306,7 +306,7 @@
+ 
+ if (border_error_flag == 0)
+     {
+-    sprintf(file_name, statresultstxt);
++    sprintf(file_name, "%s", statresultstxt);
+     if ((statres_file = fopen(file_name, "w")) == NULL) edit_error("Could not open output file : ", file_name);
+     fprintf(statres_file,"%i\n",cpt_zones[0]);
+     fprintf(statres_file,"0\n");
+--- a/Soft/data_process_sngl/statistics_histogram_extract.c
++++ b/Soft/data_process_sngl/statistics_histogram_extract.c
+@@ -241,7 +241,7 @@
+ 
+ if (strcmp(Operation, "histo") == 0) {
+ 
+-	sprintf(file_name, statisticsbin);
++	sprintf(file_name, "%s", statisticsbin);
+ 	if ((statbin_file = fopen(file_name, "wb")) == NULL) edit_error("Could not open output file : ", file_name);
+ 
+ 	/* Training Area coordinates reading */
+@@ -326,7 +326,7 @@
+ 
+ 	if (border_error_flag == 0)
+ 		{
+-	    sprintf(file_name, statresultstxt);
++	    sprintf(file_name, "%s", statresultstxt);
+ 		if ((statres_file = fopen(file_name, "w")) == NULL) edit_error("Could not open output file : ", file_name);
+ 		fprintf(statres_file,"%i\n",cpt_zones[0]);
+ 		fclose(statres_file);
+--- a/Soft/data_process_sngl/supervised_classifier_C2.c
++++ b/Soft/data_process_sngl/supervised_classifier_C2.c
+@@ -239,7 +239,7 @@
+ 	    edit_error("Could not open input file : ", file_name);
+     }
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/supervised_classifier_S2m.c
++++ b/Soft/data_process_sngl/supervised_classifier_S2m.c
+@@ -250,7 +250,7 @@
+ 	    edit_error("Could not open input file : ", file_name);
+     }
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/stat_extract_S2.c
++++ b/Soft/data_process_sngl/stat_extract_S2.c
+@@ -236,7 +236,7 @@
+       }
+    if (strcmp(Operation, "stat") == 0) {
+ 
+-sprintf(file_name, statisticsbin);
++sprintf(file_name, "%s", statisticsbin);
+ if ((statbin_file = fopen(file_name, "wb")) == NULL) edit_error("Could not open output file : ", file_name);
+ 
+ /* Training Area coordinates reading */
+@@ -307,7 +307,7 @@
+ 
+ if (border_error_flag == 0)
+     {
+-    sprintf(file_name, statresultstxt);
++    sprintf(file_name, "%s", statresultstxt);
+     if ((statres_file = fopen(file_name, "w")) == NULL) edit_error("Could not open output file : ", file_name);
+     fprintf(statres_file,"%i\n",cpt_zones[0]);
+     if (strcmp(PolarType, "full") == 0) fprintf(statres_file,"0\n");
+--- a/Soft/data_process_sngl/training_set_sampler_S2m.c
++++ b/Soft/data_process_sngl/training_set_sampler_S2m.c
+@@ -427,7 +427,7 @@
+     }				/* Class */
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/training_set_sampler_C2.c
++++ b/Soft/data_process_sngl/training_set_sampler_C2.c
+@@ -388,7 +388,7 @@
+     }				/* Class */
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/training_set_sampler_C4.c
++++ b/Soft/data_process_sngl/training_set_sampler_C4.c
+@@ -424,7 +424,7 @@
+     }				/* Class */
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/training_set_sampler_Ipp.c
++++ b/Soft/data_process_sngl/training_set_sampler_Ipp.c
+@@ -375,7 +375,7 @@
+ 
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/stat_extract_C3.c
++++ b/Soft/data_process_sngl/stat_extract_C3.c
+@@ -220,7 +220,7 @@
+       }
+    if (strcmp(Operation, "stat") == 0) {
+ 
+-sprintf(file_name, statisticsbin);
++sprintf(file_name, "%s", statisticsbin);
+ if ((statbin_file = fopen(file_name, "wb")) == NULL) edit_error("Could not open output file : ", file_name);
+ 
+ /* Training Area coordinates reading */
+@@ -288,7 +288,7 @@
+ 
+ if (border_error_flag == 0)
+     {
+-    sprintf(file_name, statresultstxt);
++    sprintf(file_name, "%s", statresultstxt);
+     if ((statres_file = fopen(file_name, "w")) == NULL) edit_error("Could not open output file : ", file_name);
+     fprintf(statres_file,"%i\n",cpt_zones[0]);
+     fprintf(statres_file,"0\n");
+--- a/Soft/data_process_sngl/stat_extract_C2.c
++++ b/Soft/data_process_sngl/stat_extract_C2.c
+@@ -207,7 +207,7 @@
+       }
+    if (strcmp(Operation, "stat") == 0) {
+ 
+-sprintf(file_name, statisticsbin);
++sprintf(file_name, "%s", statisticsbin);
+ if ((statbin_file = fopen(file_name, "wb")) == NULL) edit_error("Could not open output file : ", file_name);
+ 
+ /* Training Area coordinates reading */
+@@ -275,7 +275,7 @@
+ 
+ if (border_error_flag == 0)
+     {
+-    sprintf(file_name, statresultstxt);
++    sprintf(file_name, "%s", statresultstxt);
+     if ((statres_file = fopen(file_name, "w")) == NULL) edit_error("Could not open output file : ", file_name);
+     fprintf(statres_file,"%i\n",cpt_zones[0]);
+     fprintf(statres_file,"0\n");
+--- a/Soft/data_process_sngl/supervised_classifier_Spp.c
++++ b/Soft/data_process_sngl/supervised_classifier_Spp.c
+@@ -268,7 +268,7 @@
+ 	    edit_error("Could not open input file : ", file_name);
+     }
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/supervised_classifier_T3.c
++++ b/Soft/data_process_sngl/supervised_classifier_T3.c
+@@ -252,7 +252,7 @@
+ 	    edit_error("Could not open input file : ", file_name);
+     }
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/supervised_classifier_C3.c
++++ b/Soft/data_process_sngl/supervised_classifier_C3.c
+@@ -252,7 +252,7 @@
+ 	    edit_error("Could not open input file : ", file_name);
+     }
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/supervised_classifier_S2b.c
++++ b/Soft/data_process_sngl/supervised_classifier_S2b.c
+@@ -255,7 +255,7 @@
+ 	    edit_error("Could not open input file : ", file_name);
+     }
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/supervised_classifier_Ipp.c
++++ b/Soft/data_process_sngl/supervised_classifier_Ipp.c
+@@ -259,7 +259,7 @@
+ 	    edit_error("Could not open input file : ", file_name);
+     }
+ 
+-    sprintf(file_name, cluster_file);
++    sprintf(file_name, "%s", cluster_file);
+     if ((trn_file = fopen(file_name, "rb")) == NULL)
+ 	edit_error("Could not open parameter file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/training_set_sampler_Spp.c
++++ b/Soft/data_process_sngl/training_set_sampler_Spp.c
+@@ -447,7 +447,7 @@
+     }				/* Class */
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
+--- a/Soft/data_process_sngl/training_set_sampler_T3.c
++++ b/Soft/data_process_sngl/training_set_sampler_T3.c
+@@ -392,7 +392,7 @@
+     }				/* Class */
+     if (border_error_flag == 0)
+     {
+-	sprintf(file_name, cluster_file);
++	sprintf(file_name, "%s", cluster_file);
+ 	if ((trn_file = fopen(file_name, "wb")) == NULL)
+ 	    edit_error("Could not open output file : ", file_name);
+ 
diff --git a/debian/patches/series b/debian/patches/series
index 957eb86..d444e71 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -3,3 +3,4 @@ fix-build.patch
 spelling.patch
 launch-script.patch
 buffer-overflow.patch
+hardening.patch

-- 
Polarimetric SAR Data Processing and Educational Tool



More information about the Pkg-grass-devel mailing list