mirror of
https://github.com/intel/llvm.git
synced 2026-01-20 10:58:11 +08:00
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
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user