[Freeswitch-svn] [commit] r4116 - freeswitch/trunk/src

Freeswitch SVN mikej at freeswitch.org
Sun Feb 4 14:12:15 EST 2007


Author: mikej
Date: Sun Feb  4 14:12:14 2007
New Revision: 4116

Modified:
   freeswitch/trunk/src/switch_event.c

Log:
don't use uninitialized value of data, return error if null fmt string passed.

Modified: freeswitch/trunk/src/switch_event.c
==============================================================================
--- freeswitch/trunk/src/switch_event.c	(original)
+++ freeswitch/trunk/src/switch_event.c	Sun Feb  4 14:12:14 2007
@@ -531,13 +531,15 @@
 		ret = vsnprintf(data, 2048, fmt, ap);
 #endif
 		va_end(ap);
-	}
 
-	if (ret == -1) {
-		return SWITCH_STATUS_GENERR;
+		if (ret == -1) {
+			return SWITCH_STATUS_GENERR;
+		} else {
+			event->body = data;
+			return SWITCH_STATUS_SUCCESS;
+		}
 	} else {
-		event->body = data;
-		return SWITCH_STATUS_SUCCESS;
+		return SWITCH_STATUS_GENERR;
 	}
 }
 



More information about the Freeswitch-svn mailing list