[Home]

Summary:ASTERISK-04143: probable bug (index out of range) in chan_features.c:features_new()
Reporter:Luigi Rizzo (rizzo)Labels:
Date Opened:2005-05-11 16:56:25Date Closed:2011-06-07 14:10:28
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:channels/chan_features.c::features_new() has the following section of
code near line 456. The line with "--->" caught my attention --
subs[] is an array of 3 elements so the index 'x' is certainly wrong.
But in absence of a single line of comment i cannot tell what
is the intended behaviour. Any ideas ?

               for (x=1;x<4;x++) {
                       snprintf(tmp->name, sizeof(tmp->name), "Feature/%s/%s-%d", p->tech, p->dest, x);
                       for (y=0;y<3;y++) {  
                               if (y == index)
                                       continue;
--->                            if (p->subs[x].owner && !strcasecmp(p->subs[x].owner->name, tmp->name))
                                       break;
                       }
                       if (y >= 3)
                               break;
               }

       cheers
       luigi
Comments:By: Mark Spencer (markster) 2005-05-14 19:39:53

Fixed in CVS head.

By: Russell Bryant (russell) 2005-05-15 23:09:48

chan_features is not in 1.0

By: Digium Subversion (svnbot) 2008-01-15 15:34:22.000-0600

Repository: asterisk
Revision: 5653

U   trunk/channels/chan_features.c

------------------------------------------------------------------------
r5653 | markster | 2008-01-15 15:34:22 -0600 (Tue, 15 Jan 2008) | 2 lines

Fix incorrect variable (bug ASTERISK-4143)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=5653