[xml/sgml-pkgs] Bug#646503: FTBFS: fo-area-page.c:907:12: error: format not a string literal and no format arguments [-Werror=format-security]

Daniel T Chen seven.steps at gmail.com
Tue Oct 25 04:58:41 UTC 2011


Package: xmlroff
Version: 0.6.2-1
Followup-For: Bug #646503
User: ubuntu-devel at lists.ubuntu.com
Usertags: origin-ubuntu precise ubuntu-patch

In Ubuntu, the attached patch was applied to achieve the following:

  * Fix format-security FTBFS with gcc-4.6. (Closes: #646503)


Thanks for considering the patch.


-- System Information:
Debian Release: wheezy/sid
  APT prefers oneiric-updates
  APT policy: (500, 'oneiric-updates'), (500, 'oneiric-security'), (500, 'oneiric-proposed'), (500, 'oneiric')
Architecture: amd64 (x86_64)

Kernel: Linux 3.0.0-12-generic (SMP w/8 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
-------------- next part --------------
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/fo-xslt-transformer.c
+++ xmlroff-0.6.2/libfo/fo-xslt-transformer.c
@@ -97,6 +97,7 @@
       g_set_error (error,
 		   FO_XSLT_TRANSFORMER_ERROR,
 		   FO_XSLT_TRANSFORMER_ERROR_NO_STYLESHEET_DOC,
+		   "%s",
 		   _(fo_xslt_transformer_error_messages[FO_XSLT_TRANSFORMER_ERROR_NO_STYLESHEET_DOC]));
       return NULL;
     }
@@ -107,6 +108,7 @@
       g_set_error (error,
 		   FO_XSLT_TRANSFORMER_ERROR,
 		   FO_XSLT_TRANSFORMER_ERROR_NO_XML_DOC,
+		   "%s",
 		   _(fo_xslt_transformer_error_messages[FO_XSLT_TRANSFORMER_ERROR_NO_XML_DOC]));
       return NULL;
     }
@@ -119,6 +121,7 @@
       g_set_error (error,
 		   FO_XSLT_TRANSFORMER_ERROR,
 		   FO_XSLT_TRANSFORMER_ERROR_PARSE_FAILED,
+		   "%s",
 		   _(fo_xslt_transformer_error_messages[FO_XSLT_TRANSFORMER_ERROR_PARSE_FAILED]));
 
       return NULL;
@@ -135,6 +138,7 @@
 	  g_set_error (error,
 		       FO_XSLT_TRANSFORMER_ERROR,
 		       FO_XSLT_TRANSFORMER_ERROR_TRANSFORM_FAILED,
+		       "%s",
 		       _(fo_xslt_transformer_error_messages[FO_XSLT_TRANSFORMER_ERROR_TRANSFORM_FAILED]));
 
 	  return NULL;
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/fo-xml-doc.c
+++ xmlroff-0.6.2/libfo/fo-xml-doc.c
@@ -203,6 +203,7 @@
       g_set_error (error,
 		   FO_XML_DOC_ERROR,
 		   FO_XML_DOC_ERROR_MEMORY_PARSE_FAILED,
+		   "%s",
 		   _(fo_xml_doc_error_messages[FO_XML_DOC_ERROR_MEMORY_PARSE_FAILED]));
 
     }
@@ -246,6 +247,7 @@
       g_set_error (error,
 		   FO_XML_DOC_ERROR,
 		   FO_XML_DOC_ERROR_MEMORY_PARSE_FAILED,
+		   "%s",
 		   _(fo_xml_doc_error_messages[FO_XML_DOC_ERROR_MEMORY_PARSE_FAILED]));
 
     }
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/fo-doc-cairo.c
+++ xmlroff-0.6.2/libfo/fo-doc-cairo.c
@@ -362,6 +362,7 @@
 	  g_set_error (error,
 		       FO_DOC_ERROR,
 		       FO_DOC_ERROR_UNSUPPORTED_FORMAT,
+		       "%s",
 		       N_(fo_doc_error_messages[FO_DOC_ERROR_UNSUPPORTED_FORMAT]));
 	}
       break;
@@ -378,6 +379,7 @@
       g_set_error (error,
 		   FO_DOC_ERROR,
 		   FO_DOC_ERROR_UNSUPPORTED_FORMAT,
+		   "%s",
 		   N_(fo_doc_error_messages[FO_DOC_ERROR_UNSUPPORTED_FORMAT]));
 
     }
@@ -424,6 +426,7 @@
       g_set_error (error,
 		   FO_DOC_ERROR,
 		   FO_DOC_ERROR_FAILED,
+		   "%s",
 		   N_(fo_doc_error_messages[FO_DOC_ERROR_FAILED]));
       return;
     }
@@ -441,6 +444,7 @@
       g_set_error (error,
 		   FO_DOC_ERROR,
 		   FO_DOC_ERROR_FAILED,
+		   "%s",
 		   N_(fo_doc_error_messages[FO_DOC_ERROR_FAILED]));
       return;
     }
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/fo-node.c
+++ xmlroff-0.6.2/libfo/fo-node.c
@@ -1311,6 +1311,7 @@
 
   new_error = g_error_new (src->domain,
 			   src->code,
+			   "%s",
 			   new_message->str);
 
   g_string_free (new_message, TRUE);
@@ -1367,6 +1368,7 @@
 
   new_error = g_error_new (src->domain,
 			   src->code,
+			   "%s",
 			   new_message->str);
 
   g_string_free (new_message, TRUE);
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/fo-xsl-formatter.c
+++ xmlroff-0.6.2/libfo/fo-xsl-formatter.c
@@ -984,6 +984,7 @@
       g_set_error (error,
 		   FO_XSL_FORMATTER_ERROR,
 		   FO_XSL_FORMATTER_ERROR_NO_RESULT_TREE,
+		   "%s",
 		   _(fo_xsl_formatter_error_messages[FO_XSL_FORMATTER_ERROR_NO_RESULT_TREE]));
       return FALSE;
     }
@@ -998,6 +999,7 @@
       g_set_error (error,
 		   FO_XSL_FORMATTER_ERROR,
 		   FO_XSL_FORMATTER_ERROR_RESULT_TREE_NOT_FO,
+		   "%s\n%s",
 		   _(fo_xsl_formatter_error_messages[FO_XSL_FORMATTER_ERROR_RESULT_TREE_NOT_FO]),
 		   root_element->ns == NULL ? NULL : root_element->ns->href,
 		   root_element->name);
@@ -1009,6 +1011,7 @@
       g_set_error (error,
 		   FO_XSL_FORMATTER_ERROR,
 		   FO_XSL_FORMATTER_ERROR_NO_FO_DOC,
+		   "%s",
 		   _(fo_xsl_formatter_error_messages[FO_XSL_FORMATTER_ERROR_NO_FO_DOC]));
       return FALSE;
     }
@@ -1018,6 +1021,7 @@
       g_set_error (error,
 		   FO_XSL_FORMATTER_ERROR,
 		   FO_XSL_FORMATTER_ERROR_NO_FO_DOC,
+		   "%s",
 		   _(fo_xsl_formatter_error_messages[FO_XSL_FORMATTER_ERROR_NOT_FO_DOC]));
       return FALSE;
     }
@@ -1088,6 +1092,7 @@
       g_set_error (error,
 		   FO_XSL_FORMATTER_ERROR,
 		   FO_XSL_FORMATTER_ERROR_NO_RESULT_TREE,
+		   "%s",
 		   _(fo_xsl_formatter_error_messages[FO_XSL_FORMATTER_ERROR_NO_RESULT_TREE]));
       return FALSE;
     }
@@ -1097,6 +1102,7 @@
       g_set_error (error,
 		   FO_XSL_FORMATTER_ERROR,
 		   FO_XSL_FORMATTER_ERROR_NO_FO_DOC,
+		   "%s",
 		   _(fo_xsl_formatter_error_messages[FO_XSL_FORMATTER_ERROR_NO_FO_DOC]));
       return FALSE;
     }
@@ -1106,6 +1112,7 @@
       g_set_error (error,
 		   FO_XSL_FORMATTER_ERROR,
 		   FO_XSL_FORMATTER_ERROR_NO_FO_DOC,
+		   "%s",
 		   _(fo_xsl_formatter_error_messages[FO_XSL_FORMATTER_ERROR_NOT_FO_DOC]));
       return FALSE;
     }
@@ -1115,6 +1122,7 @@
       g_set_error (error,
 		   FO_XSL_FORMATTER_ERROR,
 		   FO_XSL_FORMATTER_ERROR_NO_AREA_TREE,
+		   "%s",
 		   _(fo_xsl_formatter_error_messages[FO_XSL_FORMATTER_ERROR_NO_AREA_TREE]));
       return FALSE;
     }
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/fo-libfo-basic.c
+++ xmlroff-0.6.2/libfo/fo-libfo-basic.c
@@ -142,6 +142,7 @@
   g_set_error (dest,
 	       new_domain,
 	       new_code,
+	       "%s",
 	       error_string);
 
   g_free (error_string);
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/expr/fo-expr-func.c
+++ xmlroff-0.6.2/libfo/expr/fo-expr-func.c
@@ -259,6 +259,7 @@
 	  g_set_error (error,
 		       FO_EXPR_EVAL_ERROR,
 		       FO_EXPR_EVAL_ERROR_INVALID_TYPE,
+		       "%s",
 		       fo_expr_eval_error_messages[FO_EXPR_EVAL_ERROR_INVALID_TYPE]);
 	}
 
@@ -269,6 +270,7 @@
 	  g_set_error (error,
 		       FO_EXPR_EVAL_ERROR,
 		       FO_EXPR_EVAL_ERROR_INVALID_ARITY,
+		       "%s",
 		       fo_expr_eval_error_messages[FO_EXPR_EVAL_ERROR_INVALID_ARITY]);
     }
 
@@ -1206,6 +1208,7 @@
       g_set_error (error,
 		   FO_EXPR_EVAL_ERROR,
 		   FO_EXPR_EVAL_ERROR_INVALID_TYPE,
+		   "%s",
 		   fo_expr_eval_error_messages[FO_EXPR_EVAL_ERROR_INVALID_TYPE]);
     }
 
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/expr/fo-expr-eval.c
+++ xmlroff-0.6.2/libfo/expr/fo-expr-eval.c
@@ -168,6 +168,7 @@
 
   error = g_error_new (FO_EXPR_EVAL_ERROR,
 		       error_type,
+		       "%s",
 		       error_string);
 
   return fo_error_new_with_value (error);
@@ -220,6 +221,7 @@
 
   new_error = g_error_new (FO_EXPR_EVAL_ERROR,
 			   error_type,
+			   "%s",
 			   error_string);
 
   return fo_error_new_with_value (new_error);
@@ -1338,6 +1340,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_NULL_RESULT,
+		   "%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_NULL_RESULT]));
     }
   else if (FO_IS_ERROR (result_datatype))
@@ -1345,6 +1348,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_ERROR_RESULT,
+		   "%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_ERROR_RESULT]));
     }
   else if (!fo_expr_context_stack_is_empty (context))
@@ -1685,6 +1689,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_NULL_RESULT,
+		   "%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_NULL_RESULT]));
     }
   else if (FO_IS_ERROR (result_datatype))
@@ -1692,6 +1697,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_ERROR_RESULT,
+		   "%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_ERROR_RESULT]));
     }
   else if (!fo_expr_context_stack_is_empty (context))
@@ -1838,6 +1844,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_NULL_RESULT,
+		   "%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_NULL_RESULT]));
     }
   else if (FO_IS_ERROR (result_datatype))
@@ -1845,6 +1852,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_ERROR_RESULT,
+		   "%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_ERROR_RESULT]));
     }
   else if (!fo_expr_context_stack_is_empty (context))
@@ -1854,6 +1862,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_EXTRA_STACK,
+		   "%s\n%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_EXTRA_STACK]),
 		   string);
 
@@ -1864,6 +1873,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_EXTRA_EXPR,
+		   "%s\n%p",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_EXTRA_EXPR]),
 		   fo_expr_context_cur_ptr (context));
     }
@@ -1978,6 +1988,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_NULL_RESULT,
+		   "%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_NULL_RESULT]));
     }
   else if (FO_IS_ERROR (result_datatype))
@@ -1985,6 +1996,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_ERROR_RESULT,
+		   "%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_ERROR_RESULT]));
     }
   else if (!fo_expr_context_stack_is_empty (context))
@@ -2306,6 +2318,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_NULL_RESULT,
+		   "%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_NULL_RESULT]));
     }
   else if (FO_IS_ERROR (result_datatype))
@@ -2313,6 +2326,7 @@
       g_set_error (error,
 		   FO_EXPR_ERROR,
 		   FO_EXPR_ERROR_ERROR_RESULT,
+		   "%s",
 		   _(fo_expr_error_messages[FO_EXPR_ERROR_ERROR_RESULT]));
     }
   else if (!fo_expr_context_stack_is_empty (context))
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/fo/fo-table-column.c
+++ xmlroff-0.6.2/libfo/fo/fo-table-column.c
@@ -1139,6 +1139,7 @@
       g_set_error (error,
 		   FO_TABLE_COLUMN_ERROR,
 		   FO_FO_ERROR_DATATYPE,
+		   "%s",
 		   _(fo_table_column_error_messages[FO_TABLE_COLUMN_ERROR_FIXED_NO_WIDTH]));
 
       fo_object_log_warning (FO_OBJECT (fo),
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/fo/fo-table.c
+++ xmlroff-0.6.2/libfo/fo/fo-table.c
@@ -1812,6 +1812,7 @@
       g_set_error (error,
 		   FO_TABLE_ERROR,
 		   FO_TABLE_ERROR_LAYOUT_METHOD_UNKNOWN,
+		   "%s",
 		   fo_table_error_messages[FO_TABLE_ERROR_LAYOUT_METHOD_UNKNOWN]);
       return;
     }
@@ -1829,6 +1830,7 @@
 	  g_set_error (error,
 		       FO_TABLE_ERROR,
 		       FO_TABLE_ERROR_FIXED_NO_COLUMN,
+		       "%s",
 		       fo_table_error_messages[FO_TABLE_ERROR_FIXED_NO_COLUMN]);
 	  return;
 	}
@@ -1923,6 +1925,7 @@
 	  g_set_error (error,
 		       FO_TABLE_ERROR,
 		       FO_TABLE_ERROR_NO_AREA,
+		       "%s",
 		       fo_table_error_messages[FO_TABLE_ERROR_NO_AREA]);
 	  return;
 	}
@@ -2625,6 +2628,7 @@
 	      GError *local_error =
 		g_error_new (FO_TABLE_ERROR,
 			     FO_TABLE_ERROR_FIXED_BUT_AUTO,
+			     "%s",
 			     fo_table_error_messages[FO_TABLE_ERROR_FIXED_BUT_AUTO]);
 
 	      fo_object_log_warning (FO_OBJECT (fo),
@@ -2705,6 +2709,7 @@
       GError *local_error =
 	g_error_new (FO_TABLE_ERROR,
 		     FO_TABLE_ERROR_FALLBACK_TO_FIXED,
+		     "%s",
 		     fo_table_error_messages[FO_TABLE_ERROR_FALLBACK_TO_FIXED]);
 
       fo_object_log_warning (FO_OBJECT (fo),
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/area/fo-area-page.c
+++ xmlroff-0.6.2/libfo/area/fo-area-page.c
@@ -904,6 +904,7 @@
 	{
 	  GError *error = g_error_new (FO_AREA_PAGE_ERROR,
 				       FO_AREA_PAGE_ERROR_OVERFLOW,
+				       "%s",
 				       fo_area_page_error_messages[FO_AREA_PAGE_ERROR_OVERFLOW]);
 
 	  fo_object_log_warning (FO_OBJECT (child),
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/property/fo-property-font-family.c
+++ xmlroff-0.6.2/libfo/property/fo-property-font-family.c
@@ -414,7 +414,7 @@
 
       if (tmp_error != NULL)
 	{
-	  g_message (tmp_error->message);
+	  g_message ("%s", tmp_error->message);
 	  g_propagate_error (error,
 			     tmp_error);
 	  return NULL;
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/libfo/property/fo-property.c
+++ xmlroff-0.6.2/libfo/property/fo-property.c
@@ -386,6 +386,7 @@
   g_set_error (error,
 	       FO_PROPERTY_ERROR,
 	       FO_PROPERTY_ERROR_NO_ENUMERATION,
+	       "%s",
 	       fo_property_error_messages[FO_PROPERTY_ERROR_NO_ENUMERATION]);
   return NULL;
 }
only in patch2:
unchanged:
--- xmlroff-0.6.2.orig/xmlroff/xmlroff.c
+++ xmlroff-0.6.2/xmlroff/xmlroff.c
@@ -302,7 +302,7 @@
 
   if (compat_stylesheet == TRUE)
     {
-      printf (libfo_compat_get_stylesheet ());
+      printf ("%s", libfo_compat_get_stylesheet ());
       exit (0);
     }
 
@@ -325,6 +325,7 @@
       g_set_error(&error,
 		  XMLROFF_ERROR,
 		  XMLROFF_ERROR_NO_FILE,
+		  "%s",
 		  xmlroff_error_messages [XMLROFF_ERROR_NO_FILE]);
 
       goto option_error;


More information about the debian-xml-sgml-pkgs mailing list