From 1a042843c8f8c1b7d0c96646dd45a6668c5c7d5c Mon Sep 17 00:00:00 2001 From: kevin Date: Thu, 8 Sep 2016 16:17:15 -0400 Subject: [PATCH] cmXScore.c : Added error checking to section marker text-to-number conversion. --- app/cmXScore.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/app/cmXScore.c b/app/cmXScore.c index 9567c65..3b72e99 100644 --- a/app/cmXScore.c +++ b/app/cmXScore.c @@ -1376,8 +1376,18 @@ void _cmXScoreSetMeasGroups( cmXScore_t* p, unsigned flag ) } if( cmIsFlag(np->flags,kSectionXsFl) ) - sectionId = np->tvalue==NULL ? 0 : strtol(np->tvalue,NULL,10); - + { + sectionId = 0; + + if( np->tvalue == NULL ) + cmErrWarnMsg(&p->err,kSyntaxErrorXsRC,"An apparent section label in measure '%i' is blank.",np->meas->number); + else + if( cmTextToUInt( np->tvalue, §ionId, NULL ) != kOkTxRC ) + cmErrWarnMsg(&p->err,kSyntaxErrorXsRC,"The section label '%s' is not an integer.",np->tvalue); + + //sectionId = np->tvalue==NULL ? 0 : strtol(np->tvalue,NULL,10); + } + n0 = NULL; } }