fix segfaults on bad api command usage MODAPP-34
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6010 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
4a1238e30b
commit
3ccda4e25e
|
@ -333,6 +333,11 @@ SWITCH_STANDARD_API(tone_detect_session_function)
|
|||
time_t to = 0;
|
||||
switch_core_session_t *rsession;
|
||||
|
||||
if (!cmd) {
|
||||
stream->write_function(stream, "USAGE: %s\n", TONE_DETECT_SYNTAX);
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
mydata = strdup(cmd);
|
||||
assert(mydata != NULL);
|
||||
|
||||
|
@ -990,6 +995,11 @@ SWITCH_STANDARD_API(sched_del_function)
|
|||
{
|
||||
uint32_t cnt = 0;
|
||||
|
||||
if (!cmd) {
|
||||
stream->write_function(stream, "Invalid syntax\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if (switch_is_digit_string(cmd)) {
|
||||
int64_t tmp;
|
||||
tmp = (uint32_t) atoi(cmd);
|
||||
|
@ -1011,6 +1021,11 @@ SWITCH_STANDARD_API(xml_wrap_api_function)
|
|||
switch_stream_handle_t mystream = { 0 };
|
||||
int encoded = 0, elen = 0;
|
||||
|
||||
if (!cmd) {
|
||||
stream->write_function(stream, "Invalid syntax\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
|
||||
if ((dcommand = strdup(cmd))) {
|
||||
if (!strncasecmp(dcommand, "encoded ", 8)) {
|
||||
encoded++;
|
||||
|
@ -1059,7 +1074,10 @@ SWITCH_STANDARD_API(sched_api_function)
|
|||
char *tm = NULL, *dcmd, *group;
|
||||
time_t when;
|
||||
|
||||
assert(cmd != NULL);
|
||||
if (!cmd) {
|
||||
stream->write_function(stream, "Invalid syntax\n");
|
||||
return SWITCH_STATUS_SUCCESS;
|
||||
}
|
||||
tm = strdup(cmd);
|
||||
assert(tm != NULL);
|
||||
|
||||
|
|
Loading…
Reference in New Issue