Index: COFF/Writer.cpp =================================================================== --- COFF/Writer.cpp +++ COFF/Writer.cpp @@ -93,7 +93,8 @@ // variable sized field (PDB Path) auto *P = reinterpret_cast(B + OutputSectionOff + sizeof(*R)); - memcpy(P, Config->PDBPath.data(), Config->PDBPath.size()); + if (Config->PDBPath.size() > 0) + memcpy(P, Config->PDBPath.data(), Config->PDBPath.size()); P[Config->PDBPath.size()] = '\0'; } };