From: olegsidorkin Date: Mon, 16 May 2022 19:21:52 +0000 (+0300) Subject: fix: Fix crash with empty include filename in preprocessor output (#1075) X-Git-Tag: v4.6.2~41 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb57a6bec5299781156f77b80bce0c497cfee9d5;p=thirdparty%2Fccache.git fix: Fix crash with empty include filename in preprocessor output (#1075) --- diff --git a/src/ccache.cpp b/src/ccache.cpp index 5316d20e1..b0c27d064 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;