[asterisk-commits] dvossel: branch 1.4 r206867 - /branches/1.4/main/callerid.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 16 16:24:19 CDT 2009


Author: dvossel
Date: Thu Jul 16 16:24:16 2009
New Revision: 206867

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=206867
Log:
avoid segfault caused by user error

If the CALLERPRES() dialplan function is set to nothing,
a segfault occurs.  This is user error to begin with, but
I'd rather see a cli warning message than have Asterisk
crash on me.


Modified:
    branches/1.4/main/callerid.c

Modified: branches/1.4/main/callerid.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/main/callerid.c?view=diff&rev=206867&r1=206866&r2=206867
==============================================================================
--- branches/1.4/main/callerid.c (original)
+++ branches/1.4/main/callerid.c Thu Jul 16 16:24:16 2009
@@ -1092,6 +1092,10 @@
 {
 	int i;
 
+	if (!data) {
+		return -1;
+	}
+
 	for (i = 0; i < ((sizeof(pres_types) / sizeof(pres_types[0]))); i++) {
 		if (!strcasecmp(pres_types[i].name, data))
 			return pres_types[i].val;




More information about the asterisk-commits mailing list