diff --git a/src/detector.c b/src/detector.c index d5184dc1..8d5231e4 100644 --- a/src/detector.c +++ b/src/detector.c @@ -780,6 +780,9 @@ size_t mystrnlen(const char *begin, size_t maxlen) { const char *disambiguate_pp(SourceFile *sourcefile) { char *p = ohcount_sourcefile_get_contents(sourcefile); + if (!p) + return NULL; + /* prepare regular expressions */ const char *error; int erroffset;