mirror of
				https://github.com/asterisk/asterisk.git
				synced 2025-10-31 02:37:10 +00:00 
			
		
		
		
	Don't duplicate our data on the stack and just use the MYSQL_ROW directly.
With large result sets we were blowing out the stack. (closes issue #19090) Reported by: mickecarlsson Patches: issue19090_trunk_svn.patch uploaded by seanbright (license 71) Tested by: mickecarlsson git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@317370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
		| @@ -398,7 +398,7 @@ static struct ast_variable *realtime_mysql(const char *database, const char *tab | |||||||
| 				} else if (ast_strlen_zero(row[i])) { | 				} else if (ast_strlen_zero(row[i])) { | ||||||
| 					row[i] = " "; | 					row[i] = " "; | ||||||
| 				} | 				} | ||||||
| 				for (stringp = ast_strdupa(row[i]), chunk = strsep(&stringp, ";"); chunk; chunk = strsep(&stringp, ";")) { | 				for (stringp = row[i], chunk = strsep(&stringp, ";"); chunk; chunk = strsep(&stringp, ";")) { | ||||||
| 					if (prev) { | 					if (prev) { | ||||||
| 						if ((prev->next = ast_variable_new(fields[i].name, decode_chunk(chunk), ""))) { | 						if ((prev->next = ast_variable_new(fields[i].name, decode_chunk(chunk), ""))) { | ||||||
| 							prev = prev->next; | 							prev = prev->next; | ||||||
| @@ -524,7 +524,7 @@ static struct ast_config *realtime_multi_mysql(const char *database, const char | |||||||
| 			for (i = 0; i < numFields; i++) { | 			for (i = 0; i < numFields; i++) { | ||||||
| 				if (ast_strlen_zero(row[i])) | 				if (ast_strlen_zero(row[i])) | ||||||
| 					continue; | 					continue; | ||||||
| 				for (stringp = ast_strdupa(row[i]), chunk = strsep(&stringp, ";"); chunk; chunk = strsep(&stringp, ";")) { | 				for (stringp = row[i], chunk = strsep(&stringp, ";"); chunk; chunk = strsep(&stringp, ";")) { | ||||||
| 					if (chunk && !ast_strlen_zero(decode_chunk(ast_strip(chunk)))) { | 					if (chunk && !ast_strlen_zero(decode_chunk(ast_strip(chunk)))) { | ||||||
| 						if (initfield && !strcmp(initfield, fields[i].name)) { | 						if (initfield && !strcmp(initfield, fields[i].name)) { | ||||||
| 							ast_category_rename(cat, chunk); | 							ast_category_rename(cat, chunk); | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user