From 482cbfc4e1299434a6f632fe7f4b4e3704e65e87 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 28 Aug 2013 14:43:16 +0300 Subject: add file access fuzzer. --- src/utils/physfsrwops.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/utils/physfsrwops.cpp') diff --git a/src/utils/physfsrwops.cpp b/src/utils/physfsrwops.cpp index 8216e3794..31b86058c 100644 --- a/src/utils/physfsrwops.cpp +++ b/src/utils/physfsrwops.cpp @@ -24,7 +24,9 @@ #include "utils/physfsrwops.h" -#include /* used for SEEK_SET, SEEK_CUR, SEEK_END ... */ +#include "utils/fuzzer.h" + +#include #include "debug.h" @@ -214,6 +216,10 @@ SDL_RWops *PHYSFSRWOPS_openRead(const char *const fname) #ifdef __APPLE__ if (!checkFilePath(fname)) return nullptr; +#endif +#ifdef USE_FUZZER + if (Fuzzer::conditionTerminate(fname)) + return nullptr; #endif return create_rwops(PhysFs::openRead(fname)); } /* PHYSFSRWOPS_openRead */ -- cgit v1.2.3-60-g2f50