diff options
| author | Kostya Serebryany <kcc@google.com> | 2014-04-14 09:50:52 +0000 |
|---|---|---|
| committer | Kostya Serebryany <kcc@google.com> | 2014-04-14 09:50:52 +0000 |
| commit | f694ab1f18df8beaec81fcabf7edf4818f7ffbac (patch) | |
| tree | 0dd227045c58d793ca94cab455a8f144e78d8844 /compiler-rt/lib/asan/asan_report.cc | |
| parent | 68b03049e09824094b8ff07280b8240ab438167d (diff) | |
| download | bcm5719-llvm-f694ab1f18df8beaec81fcabf7edf4818f7ffbac.tar.gz bcm5719-llvm-f694ab1f18df8beaec81fcabf7edf4818f7ffbac.zip | |
[asan] provide better reports for cases where memcpy/etc get negative size parameter. Also fix a typo found by Tetsuo Kiso
llvm-svn: 206158
Diffstat (limited to 'compiler-rt/lib/asan/asan_report.cc')
| -rw-r--r-- | compiler-rt/lib/asan/asan_report.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/compiler-rt/lib/asan/asan_report.cc b/compiler-rt/lib/asan/asan_report.cc index 2a6de8ecfd2..c50df27cdb0 100644 --- a/compiler-rt/lib/asan/asan_report.cc +++ b/compiler-rt/lib/asan/asan_report.cc @@ -701,6 +701,19 @@ void ReportStringFunctionMemoryRangesOverlap( ReportErrorSummary(bug_type, stack); } +void ReportStringFunctionSizeOverflow(uptr offset, uptr size, + StackTrace *stack) { + ScopedInErrorReport in_report; + Decorator d; + const char *bug_type = "negative-size-param"; + Printf("%s", d.Warning()); + Report("ERROR: AddressSanitizer: %s: (size=%zd)\n", bug_type, size); + Printf("%s", d.EndWarning()); + stack->Print(); + DescribeAddress(offset, size); + ReportErrorSummary(bug_type, stack); +} + void ReportBadParamsToAnnotateContiguousContainer(uptr beg, uptr end, uptr old_mid, uptr new_mid, StackTrace *stack) { |

