diff --git a/src/test/tptp.cpp b/src/test/tptp.cpp index bb9c6d0a5..06d00c704 100644 --- a/src/test/tptp.cpp +++ b/src/test/tptp.cpp @@ -25,6 +25,10 @@ struct tptp_case { constexpr unsigned tptp_buffer_size = 4096; static bool is_safe_file_name(char const* s) { + if (!s || !*s) + return false; + if (std::string(s).find("..") != std::string::npos) + return false; while (*s) { unsigned char c = static_cast(*s); if (!(std::isalnum(c) || c == '.' || c == '-' || c == '_'))