From f3f8e21bd31a64e994a3cabeedea5242674f7f3c Mon Sep 17 00:00:00 2001 From: Lubomir Rintel Date: Fri, 17 May 2019 19:48:45 +0200 Subject: contrib/checkpatch: properly determine the commit id boundary It doesn't have to be at the end of line, there may be more words following. Fixes: d66a1ace23c5 ('contrib/checkpatch: avoid command injection in checkpatch.pl script') --- contrib/scripts/checkpatch.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/scripts/checkpatch.pl b/contrib/scripts/checkpatch.pl index 43ea45e833..016ec8bf64 100755 --- a/contrib/scripts/checkpatch.pl +++ b/contrib/scripts/checkpatch.pl @@ -105,7 +105,7 @@ sub check_commit my $commit_id; my $commit_message; - if ($commit =~ /^([0-9a-f]{5,})$/) { + if ($commit =~ /^([0-9a-f]{5,})\b/) { $commit_id = $1; } else { return unless $required; -- cgit v1.2.1