mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-23 04:46:55 +03:00
(mc_closedir): fix NULL dereference.
Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
a9e5957196
commit
623015eb0d
@ -515,10 +515,15 @@ mc_readdir (DIR * dirp)
|
|||||||
int
|
int
|
||||||
mc_closedir (DIR * dirp)
|
mc_closedir (DIR * dirp)
|
||||||
{
|
{
|
||||||
int handle = *(int *) dirp;
|
int handle;
|
||||||
struct vfs_class *vfs;
|
struct vfs_class *vfs;
|
||||||
int result = -1;
|
int result = -1;
|
||||||
|
|
||||||
|
if (dirp == NULL)
|
||||||
|
return result;
|
||||||
|
|
||||||
|
handle = *(int *) dirp;
|
||||||
|
|
||||||
vfs = vfs_class_find_by_handle (handle);
|
vfs = vfs_class_find_by_handle (handle);
|
||||||
if (vfs != NULL)
|
if (vfs != NULL)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user