diff --git a/src/libopensc/muscle-filesystem.c b/src/libopensc/muscle-filesystem.c index ab5b6408..b18d057c 100644 --- a/src/libopensc/muscle-filesystem.c +++ b/src/libopensc/muscle-filesystem.c @@ -207,10 +207,13 @@ int mscfs_check_selection(mscfs_t *fs, int requiredItem) int mscfs_loadFileInfo(mscfs_t* fs, const u8 *path, int pathlen, mscfs_file_t **file_data, int* idx) { - msc_id fullPath; - int x; + msc_id fullPath = {{0, 0, 0, 0}}; + int x, rc; assert(fs != NULL && path != NULL && file_data != NULL); - mscfs_lookup_path(fs, path, pathlen, &fullPath, 0); + rc = mscfs_lookup_path(fs, path, pathlen, &fullPath, 0); + if (rc != SC_SUCCESS) { + return rc; + } /* Obtain file information while checking if it exists */ mscfs_check_cache(fs);