]> git.ipfire.org Git - thirdparty/asterisk.git/commit
app_voicemail/IMAP: IMAP access FATAL error: Out of memory 64/2564/1
authorAlexei Gradinari <alex2grad@gmail.com>
Thu, 7 Apr 2016 16:37:43 +0000 (12:37 -0400)
committerJoshua Colp <jcolp@digium.com>
Fri, 8 Apr 2016 18:04:14 +0000 (13:04 -0500)
commit628b613a6ac3bc207818d28bb9a2045b974611ff
treee90514fe5e650829f549109fa6d9cdc5879fbbc3
parentc9a580807dbc625a7ec2b323fc1d8146b8e62292
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