mirror of
https://github.com/Kitware/CMake.git
synced 2025-10-14 02:08:27 +08:00
Merge topic 'depfile-empty'
2c300a4c0a
Fix out-of-bounds read on empty gcc-style depfile
Acked-by: Kitware Robot <kwrobot@kitware.com>
Merge-request: !11293
This commit is contained in:
@@ -96,9 +96,9 @@ bool cmDependsCompiler::CheckDependencies(
|
||||
|
||||
std::vector<std::string> depends;
|
||||
if (format == "custom"_s) {
|
||||
auto deps = cmReadGccDepfile(
|
||||
cm::optional<cmGccDepfileContent> deps = cmReadGccDepfile(
|
||||
depFile.c_str(), this->LocalGenerator->GetCurrentBinaryDirectory());
|
||||
if (!deps) {
|
||||
if (!deps || deps->empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -130,10 +130,10 @@ bool cmDependsCompiler::CheckDependencies(
|
||||
depends.emplace_back(std::move(line));
|
||||
}
|
||||
} else if (format == "gcc"_s) {
|
||||
auto deps = cmReadGccDepfile(
|
||||
cm::optional<cmGccDepfileContent> deps = cmReadGccDepfile(
|
||||
depFile.c_str(), this->LocalGenerator->GetCurrentBinaryDirectory(),
|
||||
GccDepfilePrependPaths::Deps);
|
||||
if (!deps) {
|
||||
if (!deps || deps->empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user