]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
fix: Fix crash with empty include filename in preprocessor output (#1075)
authorolegsidorkin <olegsidorkin@users.noreply.github.com>
Mon, 16 May 2022 19:21:52 +0000 (22:21 +0300)
committerGitHub <noreply@github.com>
Mon, 16 May 2022 19:21:52 +0000 (21:21 +0200)
src/ccache.cpp

index 5316d20e16a263da59c1491f1bc0f47df1d7bbe7..b0c27d064f5ce6576adf21bbb260fc02c0823a24 100644 (file)
@@ -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;