mirror of
https://github.com/libretro/RetroArch
synced 2025-03-03 04:14:00 +00:00
patch retro_opendir to handle nullptr and empty-string input
This commit is contained in:
parent
872c364f34
commit
801ecb019a
@ -108,9 +108,13 @@ struct RDIR *retro_opendir(const char *name)
|
||||
#endif
|
||||
struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir));
|
||||
|
||||
if (!rdir)
|
||||
if (!rdir||!name)
|
||||
return NULL;
|
||||
|
||||
/* Handle empty string as current dir */
|
||||
if (*name==0)
|
||||
name=".";
|
||||
|
||||
#if defined(_WIN32)
|
||||
(void)path_wide;
|
||||
(void)path_local;
|
||||
|
Loading…
x
Reference in New Issue
Block a user