[PATCH] D42645: New simple Checker for mmap calls

David CARLIER via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 29 08:51:48 PST 2018


devnexen added inline comments.


================
Comment at: lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp:10
+//
+// This checker detects a common memory allocation security flaw.
+// Suppose 'unsigned int n' comes from an untrusted source. If the
----------------
jroelofs wrote:
> This comment was lifted from `MallocOverflowSecurityChecker.cpp`, and doesn't accurately describe what *this* checker does.
Exact sorry for that I created this patch in another machine and forgot to update. For sure I used MallocOverflowSecurityChecker header as template.


================
Comment at: lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp:58
+
+    if ((prot & (ProtWrite | ProtExec))) {
+      if (!BT) {
----------------
jroelofs wrote:
> I assume you meant:
> 
> 
> ```
> if ((prot & (ProtWrite | ProtExec)) == (ProtWrite | ProtExec)) {
> ```
> 
> ?
True


Repository:
  rC Clang

https://reviews.llvm.org/D42645





More information about the cfe-commits mailing list