shell: add NULL pointer check
This commit is contained in:
parent
fb5fa58ec3
commit
ecd64846a8
@ -218,7 +218,10 @@ PT_THREAD(cmd_ping(struct pt *pt, shell_output_func output, char *args))
|
|||||||
|
|
||||||
/* Get argument (remote IPv6) */
|
/* Get argument (remote IPv6) */
|
||||||
SHELL_ARGS_NEXT(args, next_args);
|
SHELL_ARGS_NEXT(args, next_args);
|
||||||
if(uiplib_ipaddrconv(args, &remote_addr) == 0) {
|
if(args == NULL) {
|
||||||
|
SHELL_OUTPUT(output, "Destination IPv6 address is not specified\n");
|
||||||
|
PT_EXIT(pt);
|
||||||
|
} else if(uiplib_ipaddrconv(args, &remote_addr) == 0) {
|
||||||
SHELL_OUTPUT(output, "Invalid IPv6: %s\n", args);
|
SHELL_OUTPUT(output, "Invalid IPv6: %s\n", args);
|
||||||
PT_EXIT(pt);
|
PT_EXIT(pt);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user