Skip to content

Commit

Permalink
tpm2_context: replace static_cast with checked_cast_to
Browse files Browse the repository at this point in the history
  • Loading branch information
Philipp Weber committed Dec 17, 2024
1 parent 54ef29e commit b307ce8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib/prov/tpm2/tpm2_context.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <botan/tpm2_session.h>

#include <botan/internal/fmt.h>
#include <botan/internal/int_utils.h>
#include <botan/internal/loadstor.h>
#include <botan/internal/stl_util.h>
#include <botan/internal/tpm2_algo_mappings.h>
Expand Down Expand Up @@ -197,7 +198,7 @@ template <TPM2_CAP capability, typename ReturnT>
const auto new_properties = extract(capability_data->data, count);
BOTAN_ASSERT_NOMSG(new_properties.size() <= count);
properties.insert(properties.end(), new_properties.begin(), new_properties.end());
count -= static_cast<uint32_t>(new_properties.size());
count -= checked_cast_to<uint32_t>(new_properties.size());
}

return properties;
Expand Down

0 comments on commit b307ce8

Please sign in to comment.