In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/5068f264e5db925e43c1b4fab9c9c9a44f9a1926?hp=19d6c3854e96d89bf4dc2d874df433beac27ee8b>
- Log ----------------------------------------------------------------- commit 5068f264e5db925e43c1b4fab9c9c9a44f9a1926 Author: Aaron Crane <[email protected]> Date: Thu Apr 14 11:23:12 2016 +0100 Avoid passing non-literal to format function This avoids the following error, reported by Jitka PlesnÃková <[email protected]> in a test of RC1: op.c: In function 'Perl_ck_ftst': op.c:9754:58: error: format not a string literal and no format arguments [-Werror=format-security] Perl_warner(aTHX_ packWARN(WARN_SYNTAX), array_passed_to_stat); In addition, the string in question is now made const. ----------------------------------------------------------------------- Summary of changes: op.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/op.c b/op.c index fcb1bc6..4b6b227 100644 --- a/op.c +++ b/op.c @@ -109,7 +109,7 @@ recursive, but it's recursive on basic blocks, not on tree nodes. #define CALL_RPEEP(o) PL_rpeepp(aTHX_ o) #define CALL_OPFREEHOOK(o) if (PL_opfreehook) PL_opfreehook(aTHX_ o) -static char array_passed_to_stat[] = "Array passed to stat will be coerced to a scalar"; +static const char array_passed_to_stat[] = "Array passed to stat will be coerced to a scalar"; /* Used to avoid recursion through the op tree in scalarvoid() and op_free() @@ -9751,7 +9751,7 @@ Perl_ck_ftst(pTHX_ OP *o) } else { /* diag_listed_as: Array passed to stat will be coerced to a scalar%s */ - Perl_warner(aTHX_ packWARN(WARN_SYNTAX), array_passed_to_stat); + Perl_warner(aTHX_ packWARN(WARN_SYNTAX), "%s", array_passed_to_stat); } } scalar((OP *) kid); -- Perl5 Master Repository
