From: Scott Griepentrog Date: Thu, 19 Dec 2013 16:57:29 +0000 (+0000) Subject: res_fax.c: crash on framehook with no dsp in fax detect X-Git-Tag: 11.8.0-rc1~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f1ac57bbe46cb8a059258725db6dcb9bf0015d9;p=thirdparty%2Fasterisk.git res_fax.c: crash on framehook with no dsp in fax detect In fax_detect_framehook() a null pointer reference can occur where a voice frame is processed but no dsp is attached to the fax detection structure. The code block that rejects frames that detection cannot be processed on is checking for dsp but falls through when it should instead return, as this change implements. (closes issue ASTERISK-22942) Reported by: adomjan Review: https://reviewboard.asterisk.org/r/3076/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@404351 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_fax.c b/res/res_fax.c index bc07195eeb..073777a904 100644 --- a/res/res_fax.c +++ b/res/res_fax.c @@ -3343,7 +3343,7 @@ static struct ast_frame *fax_detect_framehook(struct ast_channel *chan, struct a case AST_FRAME_VOICE: /* we have no DSP this means we not detecting CNG */ if (!faxdetect->dsp) { - break; + return f; } /* We can only process some formats*/ switch (f->subclass.format.id) {