diff options
| author | Meco Jianting Man <[email protected]> | 2021-04-21 05:58:37 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-21 05:58:37 +0800 |
| commit | 09f04bee8fef92ace93fb89e498dbf15301448ac (patch) | |
| tree | 9c0e8b8ed8fbcde5ab196f9af1c1ad690f71497b /components/utilities | |
| parent | 349a85e83f2a9db7786335674bb65d6d1d7f1dab (diff) | |
| parent | 4188301bda4f7309aa6ee5d3d35b7c65a2b59905 (diff) | |
Merge pull request #43 from RT-Thread/master
update
Diffstat (limited to 'components/utilities')
| -rw-r--r-- | components/utilities/ymodem/ry_sy.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/components/utilities/ymodem/ry_sy.c b/components/utilities/ymodem/ry_sy.c index a87f6949db..caad51d6cd 100644 --- a/components/utilities/ymodem/ry_sy.c +++ b/components/utilities/ymodem/ry_sy.c @@ -6,6 +6,7 @@ * Change Logs: * Date Author Notes * 2019-12-09 Steven Liu the first version + * 2021-04-14 Meco Man Check the file path's legitimacy of 'sy' command */ #include <rtthread.h> @@ -219,6 +220,12 @@ static rt_err_t sy(uint8_t argc, char **argv) const char *file_path; rt_device_t dev; + if (argc < 2) + { + rt_kprintf("invalid file path.\n"); + return -RT_ERROR; + } + if (argc > 2) dev = rt_device_find(argv[2]); else |
