Merged revisions 14462 via svnmerge from

https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r14462 | russell | 2006-03-23 15:13:48 -0500 (Thu, 23 Mar 2006) | 2 lines

don't crash when asked to read from a file that doesn't exist (issue #6786)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@14463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Russell Bryant 19 years ago
parent f554c03652
commit 4c1d49f5c8

@ -92,7 +92,7 @@ static int readfile_exec(struct ast_channel *chan, void *data)
} }
} }
returnvar = ast_read_textfile(file); if ((returnvar = ast_read_textfile(file))) {
if (len > 0) { if (len > 0) {
if (len < strlen(returnvar)) if (len < strlen(returnvar))
returnvar[len]='\0'; returnvar[len]='\0';
@ -101,6 +101,7 @@ static int readfile_exec(struct ast_channel *chan, void *data)
} }
pbx_builtin_setvar_helper(chan, varname, returnvar); pbx_builtin_setvar_helper(chan, varname, returnvar);
free(returnvar); free(returnvar);
}
LOCAL_USER_REMOVE(u); LOCAL_USER_REMOVE(u);
return res; return res;
} }

Loading…
Cancel
Save