[asterisk-commits] dvossel: branch 1.4 r193262 - /branches/1.4/channels/misdn_config.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri May 8 09:51:23 CDT 2009


Author: dvossel
Date: Fri May  8 09:51:09 2009
New Revision: 193262

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=193262
Log:
"misdn show config" segfaults asterisk, if no MSN lists 

(closes issue #14976)
Reported by: alecdavis
Patches:
      misdn_config.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis, FabienToune


Modified:
    branches/1.4/channels/misdn_config.c

Modified: branches/1.4/channels/misdn_config.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/channels/misdn_config.c?view=diff&rev=193262&r1=193261&r2=193262
==============================================================================
--- branches/1.4/channels/misdn_config.c (original)
+++ branches/1.4/channels/misdn_config.c Fri May  8 09:51:09 2009
@@ -798,7 +798,9 @@
 				for (; iter; iter = iter->next) {
 					strncat(tempbuf, iter->msn, sizeof(tempbuf) - strlen(tempbuf) - 1);
 				}
-				tempbuf[strlen(tempbuf)-2] = 0;
+				if (strlen(tempbuf) > 1) {
+					tempbuf[strlen(tempbuf)-2] = 0;
+				}
 			}
 			snprintf(buf, bufsize, " -> msns: %s", *tempbuf ? tempbuf : "none");
 			break;




More information about the asterisk-commits mailing list