summaryrefslogtreecommitdiff
path: root/src/utils/physfsrwops.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-08-28 14:43:16 +0300
committerAndrei Karas <akaras@inbox.ru>2013-08-29 00:18:56 +0300
commit482cbfc4e1299434a6f632fe7f4b4e3704e65e87 (patch)
treea629b12b8a768f8431de0c134990bdbaf98912b3 /src/utils/physfsrwops.cpp
parent72cc5d13430dff4e41c77482eebd9e5e421fe739 (diff)
downloadplus-482cbfc4e1299434a6f632fe7f4b4e3704e65e87.tar.gz
plus-482cbfc4e1299434a6f632fe7f4b4e3704e65e87.tar.bz2
plus-482cbfc4e1299434a6f632fe7f4b4e3704e65e87.tar.xz
plus-482cbfc4e1299434a6f632fe7f4b4e3704e65e87.zip
add file access fuzzer.
Diffstat (limited to 'src/utils/physfsrwops.cpp')
-rw-r--r--src/utils/physfsrwops.cpp8
1 files changed, 7 insertions, 1 deletions
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 <stdio.h> /* used for SEEK_SET, SEEK_CUR, SEEK_END ... */
+#include "utils/fuzzer.h"
+
+#include <stdio.h>
#include "debug.h"
@@ -215,6 +217,10 @@ SDL_RWops *PHYSFSRWOPS_openRead(const char *const fname)
if (!checkFilePath(fname))
return nullptr;
#endif
+#ifdef USE_FUZZER
+ if (Fuzzer::conditionTerminate(fname))
+ return nullptr;
+#endif
return create_rwops(PhysFs::openRead(fname));
} /* PHYSFSRWOPS_openRead */