[Home]

Summary:ASTERISK-16177: segfault in for loop embedded switch statement
Reporter:var (var)Labels:
Date Opened:2010-05-31 22:50:53Date Closed:2010-06-01 09:25:08
Priority:CriticalRegression?No
Status:Closed/CompleteComponents:PBX/pbx_ael
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:
Description:In extensions.ael, when utilising a for loop and an embedded switch statement, it is possible to cause a segmentation fault loading Asterisk (or aelparse) when trying to 'continue;' or 'break;' the for loop within the switch statement.

This seems to be a conditional sort of bug, it seems to segfault more on 'continue;' than 'break;', but it can pass some switch based 'break;' executions. This has been reproduced on 1.6.2.7 and 1.6.1.14 on separate computers.

Debian 5.0.4 x86
Ubuntu 10.04 x86

****** ADDITIONAL INFORMATION ******

Code example:

   for (x=0; ${x} < ${MAXTRY}; x=${x} + 1) {
       Playback(${SOUNDFILES}/Enter);
       Read(DEMO);

       // fail attempt if no DTMF entered
       if(${ISNULL(${DEMO})}) {
           continue;
       }

       // automated check of demo input
       GoSub(checks,demotest,1(${DEMO}));

       // demo check fail or pass
       if (${GOSUB_RETVAL} == 1) {
           Playback(${SOUNDFILES}/InvalidSelection);
           continue;
       }
       else {
           // demo is correct, playback demo input
           GoSub(functions,playdemo,1(${DEMO},2));

           Playback(${SOUNDFILES}/Press1forYes2forNo);
           Read(VALID,,1);

           switch (${VALID}) {
               case 1:
                 break;
               case 2:
                   continue;
               default:
                   Playback(${SOUNDFILES}/InvalidSelection);
           }
       }
  }
Comments:By: Paul Belanger (pabelanger) 2010-06-01 09:24:56

Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find. Thanks!