[Freeswitch-svn] [commit] r6817 - freeswitch/trunk/src/mod/endpoints/mod_woomera

Freeswitch SVN mikej at freeswitch.org
Sat Dec 15 15:50:15 EST 2007


Author: mikej
Date: Sat Dec 15 15:50:15 2007
New Revision: 6817

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c

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

Modified: freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_woomera/mod_woomera.c	Sat Dec 15 15:50:15 2007
@@ -557,9 +557,11 @@
 	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 @@
 				break;
 			}
 		}
+		if (wmsg->last > WOOMERA_ARRAY_LEN) {
+			break;
+		}
 
 		if (!cur || !cur[0]) {
 			break;



More information about the Freeswitch-svn mailing list