[asterisk-commits] kmoore: branch 11 r402709 - in /branches/11: ./ channels/chan_dahdi.c

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


Author: kmoore
Date: Tue Nov 12 09:00:36 2013
New Revision: 402709

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=402709
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

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

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

Modified: branches/11/channels/chan_dahdi.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/channels/chan_dahdi.c?view=diff&rev=402709&r1=402708&r2=402709
==============================================================================
--- branches/11/channels/chan_dahdi.c (original)
+++ branches/11/channels/chan_dahdi.c Tue Nov 12 09:00:36 2013
@@ -1800,11 +1800,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