From b8e00120b6213e2b37d4c20a00afc0a8db99796d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnim=20L=C3=A4uger?= Date: Thu, 13 Oct 2016 09:48:37 +0200 Subject: [PATCH] fix dereferencing NULL pointer in vfs_errno() (#1539) --- app/platform/vfs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/platform/vfs.c b/app/platform/vfs.c index 9baad28d..0446a11b 100644 --- a/app/platform/vfs.c +++ b/app/platform/vfs.c @@ -355,11 +355,12 @@ sint32_t vfs_chdir( const char *path ) sint32_t vfs_errno( const char *name ) { vfs_fs_fns *fs_fns; - const char *normname = normalize_path( name ); char *outname; if (!name) name = ""; // current drive + const char *normname = normalize_path( name ); + #ifdef BUILD_SPIFFS if (fs_fns = myspiffs_realm( normname, &outname, FALSE )) { return fs_fns->ferrno( );