Skip to content

Commit

Permalink
clang-tidy: fix bugprone-sizeof-expression
Browse files Browse the repository at this point in the history
Signed-off-by: Johannes Holland <[email protected]>
  • Loading branch information
Johannes Holland committed May 4, 2024
1 parent 6200a5d commit c2c2c24
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
# [TODO]
# -bugprone-not-null-terminated-result
# [TODO]
# -bugprone-sizeof-expression
# [TODO]
#
# -clang-analyzer-optin.performance.Padding
# We prefer logical/semantic order over (potentially insignificant)
Expand All @@ -31,7 +29,6 @@ Checks: "\
-bugprone-implicit-widening-of-multiplication-result, \
-bugprone-narrowing-conversions, \
-bugprone-not-null-terminated-result, \
-bugprone-sizeof-expression, \
\
clang-analyzer, \
-clang-analyzer-optin.performance.Padding, \
Expand Down
3 changes: 2 additions & 1 deletion src/tss2-fapi/api/Fapi_GetTpmBlobs.c
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ Fapi_GetTpmBlobs_Finish(

/* Marshal the public data to the output parameter. */
if (tpm2bPublic && tpm2bPublicSize) {
*tpm2bPublic = malloc(sizeof(uint8_t) * sizeof(TPM2B_PUBLIC));
// NOLINTNEXTLINE(clang-analyzer-unix.MallocSizeof)
*tpm2bPublic = malloc(sizeof(TPM2B_PUBLIC));
goto_if_null(*tpm2bPublic, "Out of memory.",
TSS2_FAPI_RC_MEMORY, error_cleanup);
offset = 0;
Expand Down

0 comments on commit c2c2c24

Please sign in to comment.