diff options
| author | Grissiom <[email protected]> | 2014-10-14 16:07:19 +0800 |
|---|---|---|
| committer | Grissiom <[email protected]> | 2014-10-14 16:07:19 +0800 |
| commit | 23cc390474f35bf6a331eff8c498b47e44835574 (patch) | |
| tree | 634ee32f5c9a89341af96e5008d221e8e3b1bf14 | |
| parent | 8615e2c8e5a0964b871282582127e4a6aad763a5 (diff) | |
msh: check path is non-null in msh_auto_complete_path
| -rw-r--r-- | components/finsh/msh.c | 3 |
1 files changed, 3 insertions, 0 deletions
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 */ |
