From 4b74d6c5b748398d8572ff87a307a8df159dae88 Mon Sep 17 00:00:00 2001 From: Eduard Voronkin Date: Thu, 18 Sep 2025 18:20:50 -0700 Subject: [PATCH] FASTBuild: fix possible collision in exec's name I was lucky enough to hit a hash collision in the first 7 hex digits (28 bits) of SHA256 :) --- Source/cmFastbuildTargetGenerator.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Source/cmFastbuildTargetGenerator.cxx b/Source/cmFastbuildTargetGenerator.cxx index a153d95c6a..864af0d492 100644 --- a/Source/cmFastbuildTargetGenerator.cxx +++ b/Source/cmFastbuildTargetGenerator.cxx @@ -155,7 +155,7 @@ std::string cmFastbuildTargetGenerator::GetCustomCommandTargetName( extras += std::to_string(static_cast(step)); cmCryptoHash hash(cmCryptoHash::AlgoSHA256); - targetName += "-" + hash.HashString(extras).substr(0, 7); + targetName += "-" + hash.HashString(extras).substr(0, 14); return targetName; }