From 3f73d6352306d470821f3ea5078b7b7f8031f0d7 Mon Sep 17 00:00:00 2001 From: Bin Jin Date: Wed, 28 Oct 2015 17:48:29 +0000 Subject: file2string: mark question mark as non-safe Escaping all question marks as well, they can be used to form trigraph characters which are effective even within string literal. --- TOOLS/file2string.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'TOOLS') diff --git a/TOOLS/file2string.pl b/TOOLS/file2string.pl index d9ad215d6d..341bb06fd6 100755 --- a/TOOLS/file2string.pl +++ b/TOOLS/file2string.pl @@ -9,8 +9,8 @@ use warnings; # the exact contents of the original file. # FIXME: why not a char array? -# treat only alphanumeric and not-" punctuation as safe -my $unsafe_chars = qr{[^][A-Za-z0-9!#%&'()*+,./:;<=>?^_{|}~ -]}; +# treat only alphanumeric and punctuations (excluding " and ?) as safe +my $unsafe_chars = qr{[^][A-Za-z0-9!#%&'()*+,./:;<=>^_{|}~ -]}; for my $file (@ARGV) { open my $fh, '<:raw', $file or next; -- cgit v1.2.3