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: d66a1ace23 ('contrib/checkpatch: avoid command injection in checkpatch.pl script')
This commit is contained in:
Lubomir Rintel 2019-05-17 19:48:45 +02:00
parent 008a4b4215
commit f3f8e21bd3

View file

@ -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;