cleanups and a check to bail on woomera messages with too many params instead of segfaulting.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@6817 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2007-12-15 20:50:15 +00:00
parent 89ba8e6195
commit 8bc983a758
1 changed files with 5 additions and 0 deletions

View File

@ -557,9 +557,11 @@ static void woomera_printf(woomera_profile * profile, switch_socket_t * socket,
va_start(ap, fmt);
#ifndef vasprintf
stuff = (char *) malloc(10240);
switch_assert(stuff);
vsnprintf(stuff, 10240, fmt, ap);
#else
res = vasprintf(&stuff, fmt, ap);
switch_assert(stuff);
#endif
va_end(ap);
if (res == -1) {
@ -694,6 +696,9 @@ static int woomera_message_parse(switch_socket_t * fd, woomera_message * wmsg, i
break;
}
}
if (wmsg->last > WOOMERA_ARRAY_LEN) {
break;
}
if (!cur || !cur[0]) {
break;