[PATCH] D42645: New simple Checker for mmap calls
Jonathan Roelofs via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 29 08:38:27 PST 2018
jroelofs added inline comments.
================
Comment at: lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp:1
+// MmapWriteExecChecker.cpp - Check for the prot argument
+//
----------------
Needs one of these at the top:
```
//===- MmapWriteExecChecker.cpp - Check the mmap prot argument ---------------*- C++ -*-===//
```
Appropriately fitted to 80-cols.
================
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
----------------
This comment was lifted from `MallocOverflowSecurityChecker.cpp`, and doesn't accurately describe what *this* checker does.
================
Comment at: lib/StaticAnalyzer/Checkers/MmapWriteExecChecker.cpp:58
+
+ if ((prot & (ProtWrite | ProtExec))) {
+ if (!BT) {
----------------
I assume you meant:
```
if ((prot & (ProtWrite | ProtExec)) == (ProtWrite | ProtExec)) {
```
?
Repository:
rC Clang
https://reviews.llvm.org/D42645
More information about the cfe-commits
mailing list