[asterisk-commits] eliel: branch group/data_api_gsoc2009 r205694 - /team/group/data_api_gsoc2009...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jul 9 15:37:47 CDT 2009


Author: eliel
Date: Thu Jul  9 15:37:44 2009
New Revision: 205694

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=205694
Log:
Allocate enough space for the search string parsing mechanism.

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=205694&r1=205693&r2=205694
==============================================================================
--- team/group/data_api_gsoc2009/main/data.c (original)
+++ team/group/data_api_gsoc2009/main/data.c Thu Jul  9 15:37:44 2009
@@ -764,15 +764,18 @@
 	int i;
 	struct ast_data_search *root, *child;
 	enum data_search_comparison cmp_type;
+	ssize_t search_string_len;
 
 	if (!search_string) {
 		ast_log(LOG_ERROR, "You must pass a valid search string.\n");
 		return NULL;
 	}
 
-	name = ast_str_alloca(64);
-	value = ast_str_alloca(256);
-	comparison = ast_str_alloca(64);
+	search_string_len = strlen(search_string);
+
+	name = ast_str_alloca(search_string_len);
+	value = ast_str_alloca(search_string_len);
+	comparison = ast_str_alloca(search_string_len);
 
 	search_string_dup = ast_strdupa(search_string);
 




More information about the asterisk-commits mailing list