gettext: fix formatting issues
cover gettext: fix formatting issues
The following changes since commit def3800c7e58d9d1b54ea1df27b190a0f6d1d544:
layer.conf: bump version for change in eSDK selftest behaviour (2017-02-19 09:38:59 -0800)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib rbt/gettext
http://cgit.openembedded.org/openembedded-core-contrib/log/?h=rbt/gettext
Robert Yang (2):
gettext: fix formatting issues
security_flags.inc: let gettext be secure
meta/conf/distro/include/security_flags.inc | 1 - ...atement.c-timsort.h-fix-formatting-issues.patch | 87 ++++++++++++++++++++++ meta/recipes-core/gettext/gettext_0.19.8.1.bb | 1 + 3 files changed, 88 insertions(+), 1 deletion(-) create mode 100644 meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch
Signature · 1 line
2.11.0.rc2.dirty
PATCH 1/2 gettext: fix formatting issues
Fixed when compile with "-Wformat -Wformat-security -Werror=format-security":
| gettext-tools/gnulib-lib/libcroco/cr-statement.c: In function 'cr_statement_dump_charset': | gettext-tools/gnulib-lib/libcroco/cr-statement.c:2661:17: error: format not a string literal and no format arguments [-Werror=format-security] | fprintf (a_fp, str) ;
And:gettext-tools/gnulib-lib/libxml/timsort.h:326:80: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=]
fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size);
[YOCTO #9544]
--- ...atement.c-timsort.h-fix-formatting-issues.patch | 87 ++++++++++++++++++++++ meta/recipes-core/gettext/gettext_0.19.8.1.bb | 1 + 2 files changed, 88 insertions(+) create mode 100644 meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch
meta/recipes-core/gettext/gettext-0.19.8.1/cr-statement.c-timsort.h-fix-formatting-issues.patch new file +87 -0
@@ -0,0 +1,87 @@ +From e546de65a333789e83f5485757967cee29ee3681 Mon Sep 17 00:00:00 2001 +From: Robert Yang <[email protected]> +Date: Sun, 19 Feb 2017 23:32:46 -0800 +Subject: [PATCH] cr-statement.c/timsort.h: fix formatting issues + +Fixed when compile with "-Wformat -Wformat-security -Werror=format-security": +| gettext-tools/gnulib-lib/libcroco/cr-statement.c: In function 'cr_statement_dump_charset': +| gettext-tools/gnulib-lib/libcroco/cr-statement.c:2661:17: error: format not a string literal and no format arguments [-Werror=format-security] +| fprintf (a_fp, str) ; + +And: +gettext-tools/gnulib-lib/libxml/timsort.h:326:80: warning: format '%lu' expects argument of type 'long unsigned int', but argument 3 has type 'unsigned int' [-Wformat=] + fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size); + +Upstream-Status: Pending + +Signed-off-by: Robert Yang <[email protected]> +--- + gettext-tools/gnulib-lib/libcroco/cr-statement.c | 10 +++++----- + gettext-tools/gnulib-lib/libxml/timsort.h | 2 +- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/gettext-tools/gnulib-lib/libcroco/cr-statement.c b/gettext-tools/gnulib-lib/libcroco/cr-statement.c +index 617520f..100104b 100644 +--- a/gettext-tools/gnulib-lib/libcroco/cr-statement.c ++++ b/gettext-tools/gnulib-lib/libcroco/cr-statement.c +@@ -2607,7 +2607,7 @@ cr_statement_dump_ruleset (CRStatement * a_this, FILE * a_fp, glong a_indent) + g_return_if_fail (a_fp && a_this); + str = cr_statement_ruleset_to_string (a_this, a_indent); + if (str) { +- fprintf (a_fp, str); ++ fprintf (a_fp, "%s", str); + g_free (str); + str = NULL; + } +@@ -2658,7 +2658,7 @@ cr_statement_dump_charset (CRStatement * a_this, FILE * a_fp, gulong a_indent) + str = cr_statement_charset_to_string (a_this, + a_indent) ; + if (str) { +- fprintf (a_fp, str) ; ++ fprintf (a_fp, "%s", str) ; + g_free (str) ; + str = NULL ; + } +@@ -2685,7 +2685,7 @@ cr_statement_dump_page (CRStatement * a_this, FILE * a_fp, gulong a_indent) + + str = cr_statement_at_page_rule_to_string (a_this, a_indent) ; + if (str) { +- fprintf (a_fp, str); ++ fprintf (a_fp, "%s", str); + g_free (str) ; + str = NULL ; + } +@@ -2711,7 +2711,7 @@ cr_statement_dump_media_rule (CRStatement * a_this, + + str = cr_statement_media_rule_to_string (a_this, a_indent) ; + if (str) { +- fprintf (a_fp, str) ; ++ fprintf (a_fp, "%s", str) ; + g_free (str) ; + str = NULL ; + } +@@ -2737,7 +2737,7 @@ cr_statement_dump_import_rule (CRStatement * a_this, FILE * a_fp, + + str = cr_statement_import_rule_to_string (a_this, a_indent) ; + if (str) { +- fprintf (a_fp, str) ; ++ fprintf (a_fp, "%s", str) ; + g_free (str) ; + str = NULL ; + } +diff --git a/gettext-tools/gnulib-lib/libxml/timsort.h b/gettext-tools/gnulib-lib/libxml/timsort.h +index 795f272..443918a 100644 +--- a/gettext-tools/gnulib-lib/libxml/timsort.h ++++ b/gettext-tools/gnulib-lib/libxml/timsort.h +@@ -323,7 +323,7 @@ static void TIM_SORT_RESIZE(TEMP_STORAGE_T *store, const size_t new_size) + SORT_TYPE *tempstore = (SORT_TYPE *)realloc(store->storage, new_size * sizeof(SORT_TYPE)); + if (tempstore == NULL) + { +- fprintf(stderr, "Error allocating temporary storage for tim sort: need %lu bytes", sizeof(SORT_TYPE) * new_size); ++ fprintf(stderr, "Error allocating temporary storage for tim sort: need %zu bytes", sizeof(SORT_TYPE) * new_size); + exit(1); + } + store->storage = tempstore; +-- +2.10.2 +
meta/recipes-core/gettext/gettext_0.19.8.1.bb +1 -0
@@ -13,6 +13,7 @@ RCONFLICTS_${PN} = "proxy-libintl" SRC_URI = "${GNU_MIRROR}/gettext/gettext-${PV}.tar.gz \ file://parallel.patch \ file://add-with-bisonlocaledir.patch \ + file://cr-statement.c-timsort.h-fix-formatting-issues.patch \ " SRC_URI[md5sum] = "97e034cf8ce5ba73a28ff6c3c0638092"
Signature · 1 line
2.11.0.rc2.dirty
PATCH 2/2 security_flags.inc: let gettext be secure
In reply to Robert YangIt has been fixed.
[YOCTO #9544]
--- meta/conf/distro/include/security_flags.inc | 1 - 1 file changed, 1 deletion(-)
meta/conf/distro/include/security_flags.inc +0 -1
@@ -95,7 +95,6 @@ SECURITY_STRINGFORMAT_pn-busybox = "" SECURITY_STRINGFORMAT_pn-cmake = "" SECURITY_STRINGFORMAT_pn-expect = "" SECURITY_STRINGFORMAT_pn-gcc = "" -SECURITY_STRINGFORMAT_pn-gettext = "" SECURITY_STRINGFORMAT_pn-kexec-tools = "" SECURITY_STRINGFORMAT_pn-oh-puzzles = ""
Signature · 1 line
2.11.0.rc2.dirty