[svn-commits] mmichelson: trunk r121649 - /trunk/main/event.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Jun 10 14:52:22 CDT 2008


Author: mmichelson
Date: Tue Jun 10 14:52:21 2008
New Revision: 121649

URL: http://svn.digium.com/view/asterisk?view=rev&rev=121649
Log:
Add an additional sanity check in case an event is passed between 
Asterisk boxes with mismatched ie_maps.


Modified:
    trunk/main/event.c

Modified: trunk/main/event.c
URL: http://svn.digium.com/view/asterisk/trunk/main/event.c?view=diff&rev=121649&r1=121648&r2=121649
==============================================================================
--- trunk/main/event.c (original)
+++ trunk/main/event.c Tue Jun 10 14:52:21 2008
@@ -186,6 +186,11 @@
 		return "";
 	}
 
+	if (ie_maps[ie_type].ie_type != ie_type) {
+		ast_log(LOG_ERROR, "The ie type passed in does not match the ie type defined in the ie table.\n");
+		return "";
+	}
+
 	return ie_maps[ie_type].name;
 }
 
@@ -193,6 +198,11 @@
 {
 	if (ie_type <= 0 || ie_type > AST_EVENT_IE_MAX) {
 		ast_log(LOG_ERROR, "Invalid IE type - '%d'\n", ie_type);
+		return AST_EVENT_IE_PLTYPE_UNKNOWN;
+	}
+
+	if (ie_maps[ie_type].ie_type != ie_type) {
+		ast_log(LOG_ERROR, "The ie type passed in does not match the ie type defined in the ie table.\n");
 		return AST_EVENT_IE_PLTYPE_UNKNOWN;
 	}
 




More information about the svn-commits mailing list