From e9dc78042979cef7768fca0189b6163422539d95 Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 19 May 2016 13:01:54 -0400 Subject: [PATCH] cmDspBuiltIn.c : Added check for an invalid initial selection value to the MsgList processor. --- dsp/cmDspBuiltIn.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dsp/cmDspBuiltIn.c b/dsp/cmDspBuiltIn.c index 771b0c8..4a22401 100644 --- a/dsp/cmDspBuiltIn.c +++ b/dsp/cmDspBuiltIn.c @@ -2613,9 +2613,12 @@ cmDspInst_t* _cmDspMsgListAlloc(cmDspCtx_t* ctx, cmDspClass_t* classPtr, unsign for(i=0; icolCnt; ++i) if( p->typeIdArray[i] == kStringTId ) ++p->symColCnt; - + _cmDspMsgListLoadSymbolMtx(ctx,p); + if( cmDspUInt( (cmDspInst_t*)p, kSelMlId ) > p->symRowCnt ) + cmErrMsg(&classPtr->err,kVarNotValidDspRC,"The default msgList selection index %i greater than the count of elements %i.",cmDspUInt( (cmDspInst_t*)p, kSelMlId ),p->symRowCnt); + cmDspSetDefaultStrcz( ctx,&p->inst, kRsrcMlId,NULL, rsrcLabel); // rsrc label cmDspSetDefaultStrcz( ctx,&p->inst, kFnMlId, NULL, fn); // file name var cmDspSetDefaultJson( ctx,&p->inst, kListMlId,NULL, np); // default tree