From: Russell Bryant Date: Fri, 22 Apr 2011 14:34:23 +0000 (+0000) Subject: Initialize buffers in getvar and getvarfull. X-Git-Tag: 1.4.42-rc1~22 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=5a3d415ea4835e25e5fa6b21a51e84dd8942beab;p=thirdparty%2Fasterisk.git Initialize buffers in getvar and getvarfull. Initialize the buffers used to hold the result from GET VARIABLE or GET VARIABLE FULL. The bug report shows func_read returning garbage in the result. It assumed that the buffer passed in was initialized, like many other functions do. In the more common code path (through the dialplan), it is initialized, so just initialize it here too. (closes issue #19050) Reported by: johnz git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@314822 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_agi.c b/res/res_agi.c index 27a13ffa52..dcce17f25f 100644 --- a/res/res_agi.c +++ b/res/res_agi.c @@ -1215,7 +1215,7 @@ static int handle_setvariable(struct ast_channel *chan, AGI *agi, int argc, char static int handle_getvariable(struct ast_channel *chan, AGI *agi, int argc, char **argv) { char *ret; - char tempstr[1024]; + char tempstr[1024] = ""; if (argc != 3) return RESULT_SHOWUSAGE;