diff options
| author | Bernard Xiong <[email protected]> | 2021-04-19 06:48:00 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-19 06:48:00 +0800 |
| commit | 65bc0faa76040e7ae7ed89ccf3344c3ec6506cb7 (patch) | |
| tree | 0f15c048e1b2e4344b0507998e1becf79f5e0b87 /components | |
| parent | 1916135b89ea365963e3dabf4539fc7fa6e5d899 (diff) | |
| parent | a6ac475df33d6e7ad09abff22879bb42962b4262 (diff) | |
Merge pull request #4609 from mysterywolf/ym
[ymodem] Check the file path's legitimacy of 'sy' command
Diffstat (limited to 'components')
| -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 |
