diff --git a/patch.c b/patch.c index 37b882b87a..4fd1ab9892 100644 --- a/patch.c +++ b/patch.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include "patch.h" @@ -499,6 +500,8 @@ static bool apply_patch_content(uint8_t **buf, ssize_t ret_size = *size; uint8_t *ret_buf = *buf; + if (!path_is_valid(patch_path)) + return false; if (!retro_read_file(patch_path, &patch_data, &patch_size)) return false; if (patch_size < 0)