Skip to contentSkip to conversation

checkpatch: Improve parse_email signature checking

PATCH Joe Perches 1 participant 1 message Feb 14, 2018 Checkpatch

lore
Share & tools
lore

Joe Perches

author maintainer
#0 lore raw

Bare email addresses with non alphanumeric characters require escape quoting before being substituted in the parse_email routine.

e.g. Reported-by: [email protected]

Do so.

---
 scripts/checkpatch.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/checkpatch.pl +1 -1
index 3d4040322ae1..2b8397da39d3 100755
@@ -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;