From: Roland McGrath Date: Thu, 11 Dec 2014 21:08:26 +0000 (-0800) Subject: Fix -Wformat-security warnings in posix/regexbug1.c X-Git-Tag: upstream/2.30~6664 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e9813cfb3d71675c87a16318b20642a366aff74c;p=external%2Fglibc.git Fix -Wformat-security warnings in posix/regexbug1.c --- diff --git a/ChangeLog b/ChangeLog index de2e7cc..59d95d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2014-12-11 Roland McGrath + + * posix/regexbug1.c (main): Use "%s" format with regerror results, + rather than assuming they won't contain any '%'s. + 2014-12-11 Chris Metcalf * sysdeps/tile/tilegx/memset.c (__memcpy): Add diff --git a/posix/regexbug1.c b/posix/regexbug1.c index 2864096..17643e7 100644 --- a/posix/regexbug1.c +++ b/posix/regexbug1.c @@ -18,7 +18,7 @@ main (void) { char buf[100]; regerror (reerr, &re, buf, sizeof buf); - error (EXIT_FAILURE, 0, buf); + error (EXIT_FAILURE, 0, "%s", buf); } if (regexec (&re, "002", 2, ma, 0) != 0) @@ -35,7 +35,7 @@ main (void) { char buf[100]; regerror (reerr, &re, buf, sizeof buf); - error (EXIT_FAILURE, 0, buf); + error (EXIT_FAILURE, 0, "%s", buf); } if (regexec (&re, "002", 2, ma, 0) != 0)