forked from OSchip/llvm-project
[llvm-readobj] Fix UB in pointer arithmetics after D105522
This commit is contained in:
parent
14b71efd97
commit
033ca45d4f
|
@ -54,6 +54,8 @@ static void printAsPrintable(raw_ostream &W, const uint8_t *Start, size_t Len) {
|
|||
|
||||
void ObjDumper::printAsStringList(StringRef StringContent,
|
||||
size_t StringDataOffset) {
|
||||
if (StringContent.size() < StringDataOffset)
|
||||
return;
|
||||
const uint8_t *StrContent = StringContent.bytes_begin();
|
||||
// Some formats contain additional metadata at the start which should not be
|
||||
// interpreted as strings. Skip these bytes, but account for them in the
|
||||
|
|
Loading…
Reference in New Issue