[asterisk-commits] bbryant: branch group/data_api_gsoc2009 r206221 - /team/group/data_api_gsoc20...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Jul 13 13:01:35 CDT 2009


Author: bbryant
Date: Mon Jul 13 13:01:31 2009
New Revision: 206221

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=206221
Log:
Fix a bug with filters that causes a crash.

Modified:
    team/group/data_api_gsoc2009/main/data.c

Modified: team/group/data_api_gsoc2009/main/data.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/main/data.c?view=diff&rev=206221&r1=206220&r2=206221
==============================================================================
--- team/group/data_api_gsoc2009/main/data.c (original)
+++ team/group/data_api_gsoc2009/main/data.c Mon Jul 13 13:01:31 2009
@@ -1132,14 +1132,14 @@
 	struct ast_data *res;
 	size_t namelen;
 
-	namelen = strlen(name) + 1;
+	namelen = ast_strlen_zero(name) ? 1 : strlen(name) + 1;
 
 	res = ao2_alloc(sizeof(*res) + namelen, data_result_destructor);
 	if (!res) {
 		return NULL;
 	}
 
-	strcpy(res->name, name);
+	strcpy(res->name, namelen ? name : "");
 
 	/* initialize the children container */
 	res->children = ao2_container_alloc(NUM_DATA_RESULT_BUCKETS, data_result_hash,




More information about the asterisk-commits mailing list