checkpatch: improve parse_email signature checking
authorJoe Perches <joe@perches.com>
Tue, 10 Apr 2018 23:33:09 +0000 (16:33 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Apr 2018 17:28:35 +0000 (10:28 -0700)
Bare email addresses with non alphanumeric characters require escape
quoting before being substituted in the parse_email routine.

e.g. Reported-by: syzbot+bbd8e9a06452cc48059b@syzkaller.appspotmail.com

Do so.

Link: http://lkml.kernel.org/r/1518631805.3678.12.camel@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Cc: Dmitry Vyukov <dvyukov@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
scripts/checkpatch.pl

index 764ffd1bb1c50dffd88c91eed4416e6071e469df..b464a4c3f86307a83219663da0a8747d2464dc16 100755 (executable)
@@ -1075,7 +1075,7 @@ sub parse_email {
        } elsif ($formatted_email =~ /(\S+\@\S+)(.*)$/) {
                $address = $1;
                $comment = $2 if defined $2;
-               $formatted_email =~ s/$address.*$//;
+               $formatted_email =~ s/\Q$address\E.*$//;
                $name = $formatted_email;
                $name = trim($name);
                $name =~ s/^\"|\"$//g;