Skip to content

Commit

Permalink
add size_t to reinterpret_cast rule
Browse files Browse the repository at this point in the history
  • Loading branch information
stoletheminerals committed Oct 19, 2024
1 parent f197b1f commit d739070
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions assets/semgrep_rules/client/reinterpret_cast.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@ int rv = PKCS5_PBKDF2_HMAC(mnemonic.data(), mnemonic.length(), reinterpret_cast<
float* float_data = reinterpret_cast<float*>(const_cast<uint8_t*>(data));
// ok: reinterpret_cast
auto orig_fn = reinterpret_cast<GetModuleFileNameExWFunction>(g_originals.functions[GET_MODULE_FILENAME_EX_W_ID]);
// ruleid: reinterpret_cast
size_t bytes_read = reinterpret_cast<size_t>(arg0);
2 changes: 1 addition & 1 deletion assets/semgrep_rules/client/reinterpret_cast.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ rules:
- pattern: reinterpret_cast<$T>($ARG)
- metavariable-regex:
metavariable: $T
regex: ^(.*int.*|.*double.*|.*float.*|.*char.*)$ # this probably needs to be tweaked
regex: ^(.*int.*|.*double.*|.*float.*|.*char.*|.*size_t.*)$ # this probably needs to be tweaked

0 comments on commit d739070

Please sign in to comment.