aboutsummaryrefslogtreecommitdiff
path: root/lib/StaticAnalyzer/Checkers/MacOSKeychainAPIChecker.cpp
AgeCommit message (Collapse)Author
2011-08-16MacOSKeychainAPIChecker: Do not report double allocation if first allocation ↵Anna Zaks
returned an error. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137720 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15MacOSKeychainAPIChecker: The security API/memory leak checker should always ↵Anna Zaks
generate regular nodes instead of sink nodes. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137681 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15Rename GRState to ProgramState, and cleanup some code formatting along the way.Ted Kremenek
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137665 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-15MacOSKeychainAPIChecker: Use llvm::SmallString instead of std::string (as ↵Anna Zaks
per code review for r137523). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137633 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12MacOSKeychainAPIChecker: If the allocated data address entered as an ↵Anna Zaks
enclosing function parameter, skip it to avoid false positives. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137526 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12MacOSKeychainAPIChecker: Anna Zaks
Report errors earlier: on checkDeadSymbols() and clear the state after the symbol we are tracking goes out of scope. Also, perform lazy error checking. Instead of forcing the paths to be split depending one the return value of the allocator, make the return symbol depend on the allocated data symbol, which prolongs its life span to the time when the allocated data symbol becomes dead. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137523 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12MacOSKeychainAPIChecker: There is no need to use SymbolMetadata to represent ↵Anna Zaks
the allocated data symbol, we can just use the symbol corresponding to the SymbolicRegion. This simplifies tracking of the symbol, for example, SymbolMetadata needs to go through extra hoops to stay alive. Make AllocationState internal to the MacOSKeychainAPIChecker class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137514 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-05KeychainAPI checker: Track SymbolMetadata instead of MemRegion in checker ↵Anna Zaks
state so that we could clear the state on evalDeadSymbols; also track the return value. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137003 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-05KeychainAPI checker: Generate an error on double allocation. Pull out ↵Anna Zaks
getAsPointeeMemoryRegion so that it could be reused. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136952 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04KeychainAPI checker: Track additional pair of SecKeychain APIs. Also, keep ↵Anna Zaks
exploring the transition on which a call to allocator function failed (to be able to find errors in examples like ErrorCodesFromDifferentAPISDoNotInterfere). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136930 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04KeychainAPI checker: Refactor to make it easier to add more ↵Anna Zaks
allocator/deallocator API pairs. Add the allocator function ID to the checker state. Better comments. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136889 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04KeychainAPI checker: refactor to use early exit.Anna Zaks
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136852 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-04KeychainAPI checker: Add basic diagnostics. Track MemoryRegion istead of ↵Anna Zaks
SymbolicRef since the address might not be a symbolic value in some cases, for example in fooOnlyFree() test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136851 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-02KeychainAPI checker: only check the paths on which the allocator function ↵Anna Zaks
returned noErr. (+ minor cleanup) git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136694 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-01Add a skeleton for the Keychain Services API Checker. Register it as OSX ↵Anna Zaks
experimental for now. Note, the checker still does not handle tracking of escaped values, taking into account the return value of the allocator functions, nor the actual bug reporting.. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136659 91177308-0d34-0410-b5e6-96231b3b80d8