From 23cc390474f35bf6a331eff8c498b47e44835574 Mon Sep 17 00:00:00 2001 From: Grissiom Date: Tue, 14 Oct 2014 16:07:19 +0800 Subject: [PATCH] msh: check path is non-null in msh_auto_complete_path --- components/finsh/msh.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/finsh/msh.c b/components/finsh/msh.c index a976705857..02cbeea196 100644 --- a/components/finsh/msh.c +++ b/components/finsh/msh.c @@ -358,6 +358,9 @@ void msh_auto_complete_path(char *path) struct dirent *dirent = RT_NULL; char *full_path, *ptr, *index; + if (!path) + return; + full_path = (char*)rt_malloc(256); if (full_path == RT_NULL) return; /* out of memory */