all repos — mgba @ d44bf73a81ba8c84021b201c50f378f19513542f

mGBA Game Boy Advance Emulator

Check if VFileOpen is actually passed a path before trying to open it
Jeffrey Pfau jeffrey@endrift.com
Sun, 19 Oct 2014 21:13:32 -0700
commit

d44bf73a81ba8c84021b201c50f378f19513542f

parent

ba5c77523d628da07cda28eb17c0ab941b98418b

1 files changed, 3 insertions(+), 0 deletions(-)

jump to
M src/util/vfs.csrc/util/vfs.c

@@ -39,6 +39,9 @@

static const char* _vdeName(struct VDirEntry* vde); struct VFile* VFileOpen(const char* path, int flags) { + if (!path) { + return 0; + } int fd = open(path, flags, 0666); return VFileFromFD(fd); }