diff options
author | Sean McBride <sean@rogue-research.com> | 2022-06-17 23:57:11 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2022-06-22 12:59:40 (GMT) |
commit | d5694e46233aa7173134fc3952b5f25a7e0b0f58 (patch) | |
tree | 4345562d4404fc697170e23485d6d650f6798699 /Source/cmStringCommand.cxx | |
parent | eccd0b92b6463f86ca010b6a256a4448bb378549 (diff) | |
download | CMake-d5694e46233aa7173134fc3952b5f25a7e0b0f58.zip CMake-d5694e46233aa7173134fc3952b5f25a7e0b0f58.tar.gz CMake-d5694e46233aa7173134fc3952b5f25a7e0b0f58.tar.bz2 |
Source: Replace uses of sprintf with safer snprintf
Diffstat (limited to 'Source/cmStringCommand.cxx')
-rw-r--r-- | Source/cmStringCommand.cxx | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Source/cmStringCommand.cxx b/Source/cmStringCommand.cxx index c3ee695..fe311d1 100644 --- a/Source/cmStringCommand.cxx +++ b/Source/cmStringCommand.cxx @@ -143,7 +143,8 @@ bool HandleHexCommand(std::vector<std::string> const& args, std::string::size_type hexIndex = 0; for (auto const& c : instr) { - sprintf(&output[hexIndex], "%.2x", static_cast<unsigned char>(c) & 0xFF); + snprintf(&output[hexIndex], 3, "%.2x", + static_cast<unsigned char>(c) & 0xFF); hexIndex += 2; } |