[Object] Always initialized StartOfFile in Archive::Child::Child constructor.
authorJacek Caban <jacek@codeweavers.com>
Fri, 21 Apr 2023 23:47:55 +0000 (23:47 +0000)
committerThurston Dang <thurston@google.com>
Sat, 22 Apr 2023 00:04:30 +0000 (00:04 +0000)
commitebee5e0473df7685086eb2f4ffb07e1bf965b3bd
tree8acf726056c34431337c9808545c25ee0b21d1ed
parent1a3f158add6099914f943ac87fb3b0b8738f8ec8
[Object] Always initialized StartOfFile in Archive::Child::Child constructor.

Fixes uninitialized memory access revealed by https://reviews.llvm.org/D146534.

In empty archives, we use Child(nullptr,nullptr,nullptr) in Archive constructor in setFirstRegular. This copies unitialized StartOfFile to FirstRegularStartOfFile, which child_begin may use later.

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D148955
llvm/lib/Object/Archive.cpp