From: Anthony Minessale Date: Fri, 14 Jul 2006 21:15:26 +0000 (+0000) Subject: fix command parser X-Git-Tag: v1.0-beta1~2523 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f45ecee21450624a6533fea1bff225e1812e6786;p=thirdparty%2Ffreeswitch.git fix command parser git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1885 d0543943-73ff-0310-b7d9-9358b9ac24b2 --- diff --git a/src/mod/applications/mod_conference/mod_conference.c b/src/mod/applications/mod_conference/mod_conference.c index 70e32ceca7..4eed40f88b 100644 --- a/src/mod/applications/mod_conference/mod_conference.c +++ b/src/mod/applications/mod_conference/mod_conference.c @@ -1423,14 +1423,29 @@ static switch_status_t conf_function(char *buf, switch_stream_handle_t *stream) } } else if (!strcasecmp(argv[1], "saymember")) { char *tbuf = NULL, *text, *name; - uint32_t id = atoi(argv[3]); + uint32_t id; conference_member_t *member; + if (argc > 3) { + id = atoi(argv[3]); + } else { + stream->write_function(stream, "(saymember) Syntax Error!"); + goto done; + } + if ((tbuf = strdup(buf))) { if ((name = strstr(tbuf, "saymember "))) { name += 10; - text = strchr(name, ' '); - id = atoi(name); + + if (*name) { + text = strchr(name, ' '); + id = atoi(name); + } else { + stream->write_function(stream, "(saymember) Syntax Error!"); + goto done; + } + + if ((member = conference_member_get(conference, id))) { if (text && conference_member_say(conference, member, text, 0) == SWITCH_STATUS_SUCCESS) {