Skip to content

Commit e8028b2

Browse files
authored
[llvm] Validate Parent object before dereference (#157460)
Fixes #157449
1 parent 0996696 commit e8028b2

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

llvm/lib/Object/Archive.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -473,9 +473,7 @@ Archive::Child::Child(const Archive *Parent, const char *Start, Error *Err)
473473
}
474474

475475
Header = Parent->createArchiveMemberHeader(
476-
Start,
477-
Parent ? Parent->getData().size() - (Start - Parent->getData().data())
478-
: 0,
476+
Start, Parent->getData().size() - (Start - Parent->getData().data()),
479477
Err);
480478

481479
// If we are pointed to real data, Start is not a nullptr, then there must be

0 commit comments

Comments
 (0)