If cont.size() is 0, the expression &_contentPool[result] has undefined
behaivior because it indexes past the end of _contentPool. llvm-svn: 149427
This commit is contained in:
parent
b2bd733593
commit
846fe662ba
|
@ -128,8 +128,7 @@ private:
|
|||
return 0;
|
||||
uint32_t result = _contentPool.size();
|
||||
llvm::ArrayRef<uint8_t> cont = atom.rawContent();
|
||||
_contentPool.insert(_contentPool.end(), cont.size(), 0);
|
||||
memcpy(&_contentPool[result], cont.data(), cont.size());
|
||||
_contentPool.insert(_contentPool.end(), cont.begin(), cont.end());
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue