---------- Forwarded message ----------
From: Ivailo <[email protected]>
Date: Mon, Dec 2, 2013 at 10:35 PM
Subject: format security patch
To: [email protected]


Attached a patch that fixes a build failure caused by use of
-Wformat -Werror=format-security in build flags. Take the credits,
I don't want medals and such. Note that it was based on 0.18.2.1.

Cheers!
--- ./gettext-tools/libgrep/m-regex.c	2013-12-02 22:32:25.564343581 +0000
+++ ./gettext-tools/libgrep/m-regex.c.new	2013-12-02 22:32:33.000343055 +0000
@@ -106,7 +106,7 @@
 
         if ((err = re_compile_pattern (motif, len,
                                        &cregex->patterns[cregex->pcount].regexbuf)) != NULL)
-          error (exit_failure, 0, err);
+          error (exit_failure, 0, "%s", err);
         cregex->pcount++;
 
         motif = sep;
--- ./gettext-tools/libgrep/m-fgrep.c	2013-01-09 04:01:27.000000000 +0000
+++ ./gettext-tools/libgrep/m-fgrep.c.new	2013-12-02 22:40:21.038309949 +0000
@@ -106,7 +106,7 @@
       for (lim = beg; lim < pattern + pattern_size && *lim != '\n'; ++lim)
         ;
       if ((err = kwsincr (ckwset->kwset, beg, lim - beg)) != NULL)
-        error (exit_failure, 0, err);
+        error (exit_failure, 0, "%s", err);
       if (lim < pattern + pattern_size)
         ++lim;
       beg = lim;
@@ -114,7 +114,7 @@
   while (beg < pattern + pattern_size);
 
   if ((err = kwsprep (ckwset->kwset)) != NULL)
-    error (exit_failure, 0, err);
+    error (exit_failure, 0, "%s", err);
   return ckwset;
 }
 

Reply via email to