summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorolegsidorkin <olegsidorkin@users.noreply.github.com>2022-05-16 22:21:52 +0300
committerGitHub <noreply@github.com>2022-05-16 21:21:52 +0200
commiteb57a6bec5299781156f77b80bce0c497cfee9d5 (patch)
treef21f804076f06f78aeab012ec19e090eb59c9371
parent42b1376142efc2e8ce647b660a27093d934be3de (diff)
downloadccache-eb57a6bec5299781156f77b80bce0c497cfee9d5.tar.gz
fix: Fix crash with empty include filename in preprocessor output (#1075)
-rw-r--r--src/ccache.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ccache.cpp b/src/ccache.cpp
index 5316d20e..b0c27d06 100644
--- a/src/ccache.cpp
+++ b/src/ccache.cpp
@@ -539,6 +539,10 @@ process_preprocessed_file(Context& ctx, Hash& hash, const std::string& path)
while (q < end && *q != '"') {
q++;
}
+ if (p == q) {
+ // Skip empty file name.
+ continue;
+ }
// Look for preprocessor flags, after the "filename".
bool system = false;
const char* r = q + 1;