Try to prevent null pointer dereference

This commit is contained in:
twinaphex 2017-05-08 22:53:06 +02:00
parent 18f06e177e
commit 779a7676d6

View File

@ -225,7 +225,7 @@ RFILE *filestream_open(const char *path, unsigned mode, ssize_t len)
stream->fd = sceIoOpen(path, flags, mode_int);
#else
#if defined(HAVE_BUFFERED_IO)
if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0)
if ((stream->hints & RFILE_HINT_UNBUFFERED) == 0 && mode_str)
{
stream->fp = fopen(path, mode_str);
if (!stream->fp)