[Asterisk-Dev] possible bug in chan_features.c ?

Luigi Rizzo rizzo at icir.org
Sat May 7 10:08:46 MST 2005


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
-----------------------------------+-------------------------------------
  Luigi RIZZO, rizzo at iet.unipi.it  . Dip. di Ing. dell'Informazione
  http://www.iet.unipi.it/~luigi/  . Universita` di Pisa
-----------------------------------+-------------------------------------



More information about the asterisk-dev mailing list