asterisk/apps
Matthew Jordan ab6e2c93f3 app_voicemail: Fix crash with IMAP backends when greetings aren't present
When an IMAP backend is in use and greetings are set to be used, but aren't
present for a user in their IMAP folder, Asterisk will crash. This occurs
due to the mailstream being set to the 'greetings' folder and being left
in that particular state, regardless of the success/failure of the attempt
to access the folder the mailstream points to. Later access of the mailstream
assumes that it points to the 'INBOX' (or some other folder), resulting in
either a crash (if the greetings folder didn't exist and the mailstream is
invalid) or an inability to read messages from the 'INBOX' folder.

This patch restores the mailstream to its correct state after accessing the
greetings. This fixes the crash, and sets the mailstream to the state that
VoiceMailMain expects.

Note that while ASTERISK-23390 also contained a patch for this issue, the
patch on ASTERISK-24786 is the one being merged here.

Review: https://reviewboard.asterisk.org/r/4459/

ASTERISK-23390 #close
Reported by: Ben Smithurst

ASTERISK-24786 #close
Reported by: Graham Barnett
Tested by: Graham Barnett
patches:
  app_voicemail.c.patch.SIGSEGV3rev2 uploaded by Graham Barnett (License 6685)
........

Merged revisions 432695 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 432696 from http://svn.asterisk.org/svn/asterisk/branches/13


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@432697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2015-03-10 18:13:27 +00:00
..
confbridge app_confbridge: Repeatedly starting and stopping recording ref leaks the recording channel. 2015-01-27 17:48:18 +00:00
Makefile make: Remove 'res_features' from libraries to link against with cygwin/mingw32 2015-02-26 04:58:38 +00:00
app_adsiprog.c Fix printf problems with high ascii characters after r413586 (1.8). 2014-12-17 10:23:32 +00:00
app_agent_pool.c app_agent_pool: Fix initial module load agent device state reporting. 2015-01-30 17:49:45 +00:00
app_alarmreceiver.c Fix typo's (retrieve, specified, address). 2015-01-23 15:13:08 +00:00
app_amd.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_authenticate.c Update Asterisk's CDRs for the new bridging framework 2013-06-17 03:00:38 +00:00
app_bridgewait.c app_bridgewait: Remove possibility of race condition between channels leaving/joining. 2014-07-25 10:54:49 +00:00
app_cdr.c CDRs: Synchronize dialplan applications that manipulate CDRs with the engine 2014-01-12 22:13:12 +00:00
app_celgenuserevent.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_chanisavail.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_channelredirect.c Merge in the bridge_construction branch to make the system use the Bridging API. 2013-05-21 18:00:22 +00:00
app_chanspy.c app_chanspy, channel: fix frame leaks 2015-02-26 17:12:12 +00:00
app_confbridge.c HTTP: Stop accepting requests on final system shutdown. 2015-02-11 17:39:13 +00:00
app_controlplayback.c Add ControlPlayback manager action 2013-01-22 15:16:20 +00:00
app_dahdiras.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_db.c Don't throw a spurious error when using DBdeltree 2013-02-14 03:49:52 +00:00
app_dial.c apps/app_dial: Don't publish DialEnd twice on unexpected GoSub/Macro values 2015-01-21 13:12:04 +00:00
app_dictate.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_directed_pickup.c PickupChan: Add ability to specify channel uniqueids as well as channel names. 2013-11-22 16:43:21 +00:00
app_directory.c manager/config: Support templates and non-unique category names via AMI 2014-10-13 16:12:17 +00:00
app_disa.c app_cdr,app_forkcdr,func_cdr: Synchronize with engine when manipulating state 2013-12-19 00:50:01 +00:00
app_dumpchan.c media formats: re-architect handling of media for performance improvements 2014-07-20 22:06:33 +00:00
app_echo.c media formats: re-architect handling of media for performance improvements 2014-07-20 22:06:33 +00:00
app_exec.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
app_externalivr.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_fax.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_festival.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_flash.c Opaquify ast_channel typedefs, fd arrays, and softhangup flag 2012-03-01 22:09:18 +00:00
app_followme.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_forkcdr.c Stasis: Allow message types to be blocked 2014-08-06 12:55:28 +00:00
app_getcpeid.c Fix printf problems with high ascii characters after r413586 (1.8). 2014-12-17 10:23:32 +00:00
app_ices.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_image.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_ivrdemo.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_jack.c core: Don't allow free to mean ast_free (and malloc, etc..). 2014-09-26 14:41:38 +00:00
app_macro.c app_macro: Don't restore the calling location on a channel redirect. 2015-01-13 18:17:51 +00:00
app_meetme.c Revert -r430452 It needs to be redone for the next major AMI version change instead. 2015-01-12 18:09:27 +00:00
app_milliwatt.c media formats: re-architect handling of media for performance improvements 2014-07-20 22:06:33 +00:00
app_minivm.c Fix typo's (retrieve, specified, address). 2015-01-23 15:13:08 +00:00
app_mixmonitor.c apps/app_mixmonitor: Move Test Event for MIXMONITOR_END to after it finishes 2015-02-15 00:33:22 +00:00
app_morsecode.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_mp3.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_nbscat.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_originate.c media formats: re-architect handling of media for performance improvements 2014-07-20 22:06:33 +00:00
app_osplookup.c Fix printf problems with high ascii characters after r413586 (1.8). 2014-12-17 10:23:32 +00:00
app_page.c uniqueid: channel linkedid, ami, ari object creation with id's 2014-03-07 15:47:55 +00:00
app_playback.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_playtones.c ast_channel opaquification of pointers and integral types 2012-02-20 23:43:27 +00:00
app_privacy.c Opaquify ast_channel structs and lists 2012-02-29 16:52:47 +00:00
app_queue.c Revert -r430452 It needs to be redone for the next major AMI version change instead. 2015-01-12 18:09:27 +00:00
app_read.c ast_channel opaquification of pointers and integral types 2012-02-20 23:43:27 +00:00
app_readexten.c Opaquify ast_channel structs and lists 2012-02-29 16:52:47 +00:00
app_record.c app_record: Fix bug where using the 'k' option and hanging up would trim 1/4 of a second of the recording. 2014-12-01 13:41:43 +00:00
app_saycounted.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_sayunixtime.c Say: If SAY_DTMF_INTERRUPT is set to an ast_true value, jump on DTMF 2013-11-14 20:32:45 +00:00
app_senddtmf.c Add pause one second W dial modifier. 2012-09-28 18:27:02 +00:00
app_sendtext.c ast_channel opaquification of pointers and integral types 2012-02-20 23:43:27 +00:00
app_setcallerid.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_skel.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_sms.c Fix printf problems with high ascii characters after r413586 (1.8). 2014-12-17 10:23:32 +00:00
app_softhangup.c ast_channel opaquification of pointers and integral types 2012-02-20 23:43:27 +00:00
app_speech_utils.c datastores: Audit ast_channel_datastore_remove usage. 2014-07-28 18:58:43 +00:00
app_stack.c main/cdrs: Preserve context/extension when executing a Macro or GoSub 2014-09-05 22:04:33 +00:00
app_stasis.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_system.c Multiple revisions 369001-369002 2012-06-15 16:20:16 +00:00
app_talkdetect.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_test.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_transfer.c Documentation: doc fixes across various parts of the code for ASTERISK issues 23061,23028,23046,23027 2014-01-17 17:16:14 +00:00
app_url.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_userevent.c ARI: Add ability to raise arbitrary User Events 2014-05-22 16:09:51 +00:00
app_verbose.c Allow Asterisk to compile under GCC 4.10 2014-05-09 22:49:26 +00:00
app_voicemail.c app_voicemail: Fix crash with IMAP backends when greetings aren't present 2015-03-10 18:13:27 +00:00
app_voicemail.exports.in Remove some symbol exports that got missed in the removal of global symbols. 2012-06-15 15:33:41 +00:00
app_waitforring.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_waitforsilence.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
app_waituntil.c Merged revisions 328247 via svnmerge from 2011-07-14 20:28:54 +00:00
app_while.c Clean up and ensure proper usage of alloca() 2012-07-31 20:21:43 +00:00
app_zapateller.c Add module support level to ast_module_info structure. Print it in CLI "module show" . 2014-07-25 16:47:17 +00:00
enter.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00
leave.h remove extraneous svn:executable properties 2005-11-29 18:24:39 +00:00