[llvm-objcopy] [COFF] Don't call memcpy() with a null argument. NFC.
It is invalid to call memcpy with a null pointer, even if the size is zero. This should fix the sanitizer buildbot. llvm-svn: 349808
This commit is contained in:
parent
f17421e595
commit
02e96dd039
|
@ -225,6 +225,7 @@ void COFFWriter::writeSections() {
|
||||||
S.Header.SizeOfRawData - S.Contents.size());
|
S.Header.SizeOfRawData - S.Contents.size());
|
||||||
|
|
||||||
Ptr += S.Header.SizeOfRawData;
|
Ptr += S.Header.SizeOfRawData;
|
||||||
|
if (!S.Relocs.empty())
|
||||||
memcpy(Ptr, S.Relocs.data(), S.Relocs.size() * sizeof(coff_relocation));
|
memcpy(Ptr, S.Relocs.data(), S.Relocs.size() * sizeof(coff_relocation));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue