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:
Greg Clayton
2013-02-08 21:59:34 +00:00
parent 0dd5e7b598
commit aa4c47a5b1

View File

@@ -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;