diff options
| author | Adam Balogh <adam.balogh@ericsson.com> | 2017-11-23 12:33:12 +0000 |
|---|---|---|
| committer | Adam Balogh <adam.balogh@ericsson.com> | 2017-11-23 12:33:12 +0000 |
| commit | 4c488975daf72e5ffd3b57971950d9e563d65074 (patch) | |
| tree | 14a270a50dd7c41085b59f7a3b5d5d8337359b6d /llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h | |
| parent | 2079defd8d13d6eebe7d902d08733afbc8198faf (diff) | |
| download | bcm5719-llvm-4c488975daf72e5ffd3b57971950d9e563d65074.tar.gz bcm5719-llvm-4c488975daf72e5ffd3b57971950d9e563d65074.zip | |
[clang-tidy] Misplaced Operator in Strlen in Alloc
A possible error is to write `malloc(strlen(s+1))` instead of
`malloc(strlen(s)+1)`. Unfortunately the former is also valid syntactically,
but allocates less memory by two bytes (if `s` is at least one character long,
undefined behavior otherwise) which may result in overflow cases. This check
detects such cases and also suggests the fix for them.
Fix for r318906, forgot to add new files.
llvm-svn: 318907
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.h')
0 files changed, 0 insertions, 0 deletions

