[asterisk-commits] kmoore: branch 12 r402710 - in /branches/12: ./ channels/chan_dahdi.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Nov 12 09:02:21 CST 2013


Author: kmoore
Date: Tue Nov 12 09:02:18 2013
New Revision: 402710

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402710
Log:
chan_dahdi: Fix crash during caller ID read

Asterisk will sometimes core dump during caller id read on analog
channels due to a negative return value from the read() in
my_get_callerid that slips through as a negative length argument to
callerid_feed() if the errno returned by DAHDI is ELAST. This change
ensures that the negative return is treated properly even when it is
ELAST.

(closes issue ASTERISK-22746)
Reported by: Michael Walton
Patch by: Michael Walton
........

Merged revisions 402708 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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

Modified:
    branches/12/   (props changed)
    branches/12/channels/chan_dahdi.c

Propchange: branches/12/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: branches/12/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/12/channels/chan_dahdi.c?view=diff&rev=402710&r1=402709&r2=402710
==============================================================================
--- branches/12/channels/chan_dahdi.c (original)
+++ branches/12/channels/chan_dahdi.c Tue Nov 12 09:02:18 2013
@@ -1219,11 +1219,8 @@
 		 * a failure and die, and returning 2 means no event was received. */
 		res = read(p->subs[index].dfd, buf, sizeof(buf));
 		if (res < 0) {
-			if (errno != ELAST) {
-				ast_log(LOG_WARNING, "read returned error: %s\n", strerror(errno));
-				callerid_free(p->cs);
-				return -1;
-			}
+			ast_log(LOG_WARNING, "read returned error: %s\n", strerror(errno));
+			return -1;
 		}
 
 		if (analog_p->ringt > 0) {




More information about the asterisk-commits mailing list