[svn-commits] mjordan: trunk r397568 - /trunk/main/config_options.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Fri Aug 23 13:02:38 CDT 2013


Author: mjordan
Date: Fri Aug 23 13:02:36 2013
New Revision: 397568

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397568
Log:
Prevent seg fault in off nominal path when registered option fails to validate

If an option is registered to a type and it is the last known type in the list
of registered types, and the option fails to register, an overrun of the types
array can occur due to the index variable having been already incremented.


Modified:
    trunk/main/config_options.c

Modified: trunk/main/config_options.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/config_options.c?view=diff&rev=397568&r1=397567&r2=397568
==============================================================================
--- trunk/main/config_options.c (original)
+++ trunk/main/config_options.c Fri Aug 23 13:02:36 2013
@@ -188,7 +188,7 @@
 #endif /* AST_XML_DOCS */
 		) {
 			do {
-				ao2_unlink(types[idx]->internal->opts, opt);
+				ao2_unlink(types[idx - 1]->internal->opts, opt);
 			} while (--idx);
 			return -1;
 		}




More information about the svn-commits mailing list