[asterisk-commits] kpfleming: branch kpfleming/manager-stack r49673 - /team/kpfleming/manager-st...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri Jan 5 15:09:25 MST 2007


Author: kpfleming
Date: Fri Jan  5 16:09:24 2007
New Revision: 49673

URL: http://svn.digium.com/view/asterisk?view=rev&rev=49673
Log:
don't increment the array index until after the array entry has been filled in

Modified:
    team/kpfleming/manager-stack/main/manager.c

Modified: team/kpfleming/manager-stack/main/manager.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/manager-stack/main/manager.c?view=diff&rev=49673&r1=49672&r2=49673
==============================================================================
--- team/kpfleming/manager-stack/main/manager.c (original)
+++ team/kpfleming/manager-stack/main/manager.c Fri Jan  5 16:09:24 2007
@@ -2459,10 +2459,10 @@
 		size_t hdrlen;
 
 		for (x = 0; params && (x < AST_MAX_MANHEADERS); x++, params = params->next) {
-			m.hdrcount = x + 1;
 			hdrlen = strlen(params->name) + strlen(params->value) + 3;
 			m.headers[m.hdrcount] = alloca(hdrlen);
 			snprintf((char *) m.headers[m.hdrcount], hdrlen, "%s: %s", params->name, params->value);
+			m.hdrcount = x + 1;
 		}
 
 		if (process_message(s, &m)) {



More information about the asterisk-commits mailing list