Skip to content

Commit c83cfe4

Browse files
committed
C++: Make output clearer in cases where the function name is a macro expansion (I've seen this more than once).
1 parent 3c6f318 commit c83cfe4

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

cpp/ql/src/experimental/Security/CWE/CWE-1240/CustomCryptographicPrimitive.ql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,6 @@ where
8282
amount = strictcount(Expr e | computeHeuristic(e) and e.getEnclosingFunction() = f) and
8383
amount >= 8 and
8484
exists(f.getFile().getRelativePath()) // exclude library files
85-
select f, "This may be a custom implementation of a cryptographic primitive."
85+
select f,
86+
"This function, \"" + f.getName() +
87+
"\", may be a custom implementation of a cryptographic primitive."
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
| tests_crypto.cpp:11:6:11:18 | encryptString | This may be a custom implementation of a cryptographic primitive. |
2-
| tests_crypto.cpp:30:6:30:14 | MyEncrypt | This may be a custom implementation of a cryptographic primitive. |
3-
| tests_crypto.cpp:83:6:83:18 | init_aes_sbox | This may be a custom implementation of a cryptographic primitive. |
1+
| tests_crypto.cpp:11:6:11:18 | encryptString | This function, "encryptString", may be a custom implementation of a cryptographic primitive. |
2+
| tests_crypto.cpp:30:6:30:14 | MyEncrypt | This function, "MyEncrypt", may be a custom implementation of a cryptographic primitive. |
3+
| tests_crypto.cpp:83:6:83:18 | init_aes_sbox | This function, "init_aes_sbox", may be a custom implementation of a cryptographic primitive. |

0 commit comments

Comments
 (0)