]> granicus.if.org Git - procps-ng/commitdiff
pgrep: Fix format security
authorCraig Small <csmall@dropbear.xyz>
Tue, 2 Nov 2021 06:19:37 +0000 (17:19 +1100)
committerCraig Small <csmall@dropbear.xyz>
Tue, 2 Nov 2021 06:19:37 +0000 (17:19 +1100)
do_regcomp() error message didn't use a string literal for the format string.

pgrep.c:538:24: error: format not a string literal and no format arguments
[-Werror=format-security]

Signed-off-by: Craig Small <csmall@dropbear.xyz>
pgrep.c

diff --git a/pgrep.c b/pgrep.c
index 6457fd40c7a5407c869e758fdddca7d7fb1a5cc2..cbcb4cb151acf3acbac8531ec3383e01b7e90b51 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -534,7 +534,7 @@ static regex_t * do_regcomp (void)
 
         if (re_err) {
             regerror (re_err, preg, errbuf, sizeof(errbuf));
-            xerrx(EXIT_USAGE, errbuf);
+            xerrx(EXIT_USAGE, _("regex error: %s"), errbuf);
         }
     }
     return preg;