mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-03 11:25:35 +00:00
app_voicemail: Prevent crash when saving message with realtime voicemail
ast_store_realtime() is not NULL tolerant, so we need to initialize the field values we pass to it to the empty string to avoid a crash. ASTERISK-23739 #close Reported by: Stas Kobzar Change-Id: I756c5dd0299c77f4274368f7c99eb0464367466c
This commit is contained in:
@@ -4718,11 +4718,15 @@ static int copy(char *infile, char *outfile)
|
||||
static void copy_plain_file(char *frompath, char *topath)
|
||||
{
|
||||
char frompath2[PATH_MAX], topath2[PATH_MAX];
|
||||
struct ast_variable *tmp,*var = NULL;
|
||||
const char *origmailbox = NULL, *context = NULL, *macrocontext = NULL, *exten = NULL, *priority = NULL, *callerchan = NULL, *callerid = NULL, *origdate = NULL, *origtime = NULL, *category = NULL, *duration = NULL;
|
||||
struct ast_variable *tmp, *var = NULL;
|
||||
const char *origmailbox = "", *context = "", *macrocontext = "", *exten = "";
|
||||
const char *priority = "", *callerchan = "", *callerid = "", *origdate = "";
|
||||
const char *origtime = "", *category = "", *duration = "";
|
||||
|
||||
ast_filecopy(frompath, topath, NULL);
|
||||
snprintf(frompath2, sizeof(frompath2), "%s.txt", frompath);
|
||||
snprintf(topath2, sizeof(topath2), "%s.txt", topath);
|
||||
|
||||
if (ast_check_realtime("voicemail_data")) {
|
||||
var = ast_load_realtime("voicemail_data", "filename", frompath, SENTINEL);
|
||||
/* This cycle converts ast_variable linked list, to va_list list of arguments, may be there is a better way to do it? */
|
||||
|
Reference in New Issue
Block a user