lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 5 Jan 2021 15:38:56 +0530
From:   Dwaipayan Ray <dwaipayanray1@...il.com>
To:     Joe Perches <joe@...ches.com>
Cc:     linux-kernel-mentees@...ts.linuxfoundation.org,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: Re: [PATCH] checkpatch: fix unescaped left braces

On Tue, Jan 5, 2021 at 3:31 PM Joe Perches <joe@...ches.com> wrote:
>
> On Tue, 2021-01-05 at 15:05 +0530, Dwaipayan Ray wrote:
> > Perl 5.22 onwards require that "A literal "{" should now be
> > escaped in a pattern".
>
> Not quite correct.
>
> > checkpatch contains several literal "{". Fix such instances
> > by preceding them with a backslash.
>
> Not all literal left braces need to be escaped.
> https://www.perlmonks.org/?node_id=1191981
>

Thanks, I got this from perl diag:

"
The contexts where no warnings or errors are raised are:
as the first character in a pattern, or following "^" indicating to
anchor the match to the beginning of a line.
as the first character following a "|" indicating alternation.
as the first character in a parenthesized grouping like
/foo({bar)/
/foo(?:{bar)/
as the first character following a quantifier
/\s*{/
"

I will update the patch with the above in mind.

> > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> []
> > @@ -2036,7 +2036,7 @@ sub annotate_values {
> >                       print "ASSIGN($1)\n" if ($dbg_values > 1);
> >                       $type = 'N';
> >
> >
> > -             } elsif ($cur =~/^(;|{|})/) {
> > +             } elsif ($cur =~ /^(;|\{|\})/) {
>
> Like this one.  And why escape the right brace too?
>
The right brace escape was just for the expression to look a bit even.
It's unneeded, will remove these too.
> >                       print "END($1)\n" if ($dbg_values > 1);
> >                       $type = 'E';
> >                       $av_pend_colon = 'O';
> > @@ -3913,7 +3913,7 @@ sub process {
> >                       # it there is no point in retrying a statement scan
> >                       # until we hit end of it.
> >                       my $frag = $stat; $frag =~ s/;+\s*$//;
> > -                     if ($frag !~ /(?:{|;)/) {
> > +                     if ($frag !~ /(?:\{|;)/) {
>
> And here.
>
> etc...
>

Thank you,
Dwaipayan.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ