diff options
| author | Greg Clayton <gclayton@apple.com> | 2013-02-08 21:59:34 +0000 |
|---|---|---|
| committer | Greg Clayton <gclayton@apple.com> | 2013-02-08 21:59:34 +0000 |
| commit | aa4c47a5b1361ec3f0ccecb9d068c0c6afcb82a7 (patch) | |
| tree | 664bbccd49c0ee19374e0cf7ec5fdc5e27a4c3b1 /lldb | |
| parent | 0dd5e7b598919428be8cecf906c2015fc3835d6c (diff) | |
| download | bcm5719-llvm-aa4c47a5b1361ec3f0ccecb9d068c0c6afcb82a7.tar.gz bcm5719-llvm-aa4c47a5b1361ec3f0ccecb9d068c0c6afcb82a7.zip | |
Fixed a store to data that isn't needed and that also could end up writing beyond the end of the buffer. This was found by the address sanitizer.
llvm-svn: 174755
Diffstat (limited to 'lldb')
| -rw-r--r-- | lldb/source/DataFormatters/CXXFormatterFunctions.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lldb/source/DataFormatters/CXXFormatterFunctions.cpp b/lldb/source/DataFormatters/CXXFormatterFunctions.cpp index 78b63e9188f..1edb458ecbf 100644 --- a/lldb/source/DataFormatters/CXXFormatterFunctions.cpp +++ b/lldb/source/DataFormatters/CXXFormatterFunctions.cpp @@ -157,7 +157,7 @@ DumpUTFBufferToStream (ConversionResult (*ConvertFunction) (const SourceDataType if (sourceSize == 0) { const int origin_encoding = 8*sizeof(SourceDataType); - sourceSize = bufferSPSize/(origin_encoding >> 2); + sourceSize = bufferSPSize/(origin_encoding / 4); } SourceDataType *data_ptr = (SourceDataType*)data.GetDataStart(); @@ -173,7 +173,6 @@ DumpUTFBufferToStream (ConversionResult (*ConvertFunction) (const SourceDataType data_ptr++; } - *data_ptr = 0; data_ptr = (SourceDataType*)data.GetDataStart(); lldb::DataBufferSP utf8_data_buffer_sp; |

