Przeglądaj źródła

cmDspBuiltIn.c : Added check for an invalid initial selection value to the MsgList processor.

master
kevin 8 lat temu
rodzic
commit
e9dc780429
1 zmienionych plików z 4 dodań i 1 usunięć
  1. 4
    1
      dsp/cmDspBuiltIn.c

+ 4
- 1
dsp/cmDspBuiltIn.c Wyświetl plik

@@ -2613,9 +2613,12 @@ cmDspInst_t*  _cmDspMsgListAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsign
2613 2613
       for(i=0; i<p->colCnt; ++i)
2614 2614
         if( p->typeIdArray[i] == kStringTId )
2615 2615
           ++p->symColCnt;
2616
-   
2616
+
2617 2617
       _cmDspMsgListLoadSymbolMtx(ctx,p);
2618 2618
 
2619
+      if( cmDspUInt( (cmDspInst_t*)p, kSelMlId ) > p->symRowCnt )
2620
+        cmErrMsg(&classPtr->err,kVarNotValidDspRC,"The default msgList selection index %i greater than the count of elements %i.",cmDspUInt( (cmDspInst_t*)p, kSelMlId ),p->symRowCnt);     
2621
+      
2619 2622
       cmDspSetDefaultStrcz( ctx,&p->inst, kRsrcMlId,NULL, rsrcLabel); // rsrc label 
2620 2623
       cmDspSetDefaultStrcz( ctx,&p->inst, kFnMlId,  NULL, fn);        // file name var
2621 2624
       cmDspSetDefaultJson( ctx,&p->inst,  kListMlId,NULL, np);        // default tree

Ładowanie…
Anuluj
Zapisz