From fc087647188561345055f71a0ee00f92c1c813ec Mon Sep 17 00:00:00 2001 From: kpl Date: Thu, 1 Nov 2012 23:21:17 -0700 Subject: [PATCH] cmPrefs.c/h Added use of kMaxVarPrId --- cmPrefs.c | 6 ++++++ cmPrefs.h | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/cmPrefs.c b/cmPrefs.c index 486c8a6..524adfd 100644 --- a/cmPrefs.c +++ b/cmPrefs.c @@ -305,6 +305,8 @@ cmPrRC_t cmPrefsInitialize( cmPrH_t* hp, const cmChar_t* fn, cmPrefsOnChangeFunc p->fn = cmLHeapAllocZ( p->lhH, strlen(fn)+1 ); strcpy(p->fn,fn); + p->id = kMaxVarPrId; + hp->h = p; errLabel: @@ -1169,6 +1171,10 @@ cmPrRC_t _cmPrefsCreateJsonNode( int i; assert( pathCnt >= 1 ); + + if( id != cmInvalidId && id >= kMaxVarPrId ) + return cmErrMsg(&p->err,kNodeCreateFailPrRC,"User supplied id's must be less than 0x%x.",kMaxVarPrId); + // for each path element for(i=0; i