fix dereferencing NULL pointer in vfs_errno() (#1539)
This commit is contained in:
parent
025805b0e8
commit
b8e00120b6
|
@ -355,11 +355,12 @@ sint32_t vfs_chdir( const char *path )
|
||||||
sint32_t vfs_errno( const char *name )
|
sint32_t vfs_errno( const char *name )
|
||||||
{
|
{
|
||||||
vfs_fs_fns *fs_fns;
|
vfs_fs_fns *fs_fns;
|
||||||
const char *normname = normalize_path( name );
|
|
||||||
char *outname;
|
char *outname;
|
||||||
|
|
||||||
if (!name) name = ""; // current drive
|
if (!name) name = ""; // current drive
|
||||||
|
|
||||||
|
const char *normname = normalize_path( name );
|
||||||
|
|
||||||
#ifdef BUILD_SPIFFS
|
#ifdef BUILD_SPIFFS
|
||||||
if (fs_fns = myspiffs_realm( normname, &outname, FALSE )) {
|
if (fs_fns = myspiffs_realm( normname, &outname, FALSE )) {
|
||||||
return fs_fns->ferrno( );
|
return fs_fns->ferrno( );
|
||||||
|
|
Loading…
Reference in New Issue