]> git.ipfire.org Git - thirdparty/asterisk.git/commit
app_voicemail/IMAP: IMAP access FATAL error: Out of memory 45/2545/4
authorAlexei Gradinari <alex2grad@gmail.com>
Thu, 7 Apr 2016 16:37:43 +0000 (12:37 -0400)
committerJoshua Colp <jcolp@digium.com>
Thu, 7 Apr 2016 22:10:30 +0000 (17:10 -0500)
commitbc320df173623ab6e4b11c4e6bfd3a4bc7d023f3
treeb4653ee3fe3ee6a11a6784f3a75983c6fb97b467
parent8207372e663bdaa44acbe8fd6a262eead5532ad8
app_voicemail/IMAP: IMAP access FATAL error: Out of memory

Sometimes uw-imap function 'mail_fetchbody' returns huge len
which then pass to uw-imap function 'rfc822_base64'.
uw-imap tries to allocate huge memory and abort() on fail.

This patch check the len.
If the len more than max size (128 Mbytes) log error.
This patch also set variables len, newlen to avoid uninizialezed len.
This patch also check pointer returned by rfc822_base64.

ASTERISK-25899 #close

Change-Id: I4a0e7d655f11abef6a5224e2169df6d5c1f1caca
apps/app_voicemail.c