[PATCH] D71033: [analyzer] CERT: StrChecker: 32.c

Csaba Dabis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 4 14:29:07 PST 2019


Charusso marked an inline comment as done.
Charusso added inline comments.


================
Comment at: clang/lib/StaticAnalyzer/Checkers/cert/StrChecker.cpp:357
+
+  // 'strlen(something) + something' is most likely fine.
+  // FIXME: Use the 'SValVisitor' to catch every such constructs of the symbol.
----------------
This is a huge assumption to make this checker as simple as possible. On each allocation I would store the memory regions which the size expression consists of. When we encounter a memory/string handler function call which has a size-expression parameter we could match whether the allocation considered the length of the string it will store.

May we will have a better idea, so I would leave that as it is, for now.


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D71033/new/

https://reviews.llvm.org/D71033





More information about the cfe-commits mailing list