From 552b2d17668add44f59f721ee6c1dc328c6067da Mon Sep 17 00:00:00 2001 From: Michael Davidsaver Date: Fri, 19 Feb 2021 15:40:39 -0800 Subject: [PATCH] dbConstAddLink bounds check dbrType cf. 6c914d19c3cfa2d183e44b7fe2c6211ab8c24a58 --- modules/database/src/ioc/db/dbConstLink.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/database/src/ioc/db/dbConstLink.c b/modules/database/src/ioc/db/dbConstLink.c index 153b39c93..5ba79f2b0 100644 --- a/modules/database/src/ioc/db/dbConstLink.c +++ b/modules/database/src/ioc/db/dbConstLink.c @@ -169,6 +169,9 @@ static long dbConstLoadScalar(struct link *plink, short dbrType, void *pbuffer) return dbPutConvertJSON(pstr, dbrType, pbuffer, &nReq); } + if(dbrType>=NELEMENTS(convert)) + return S_db_badDbrtype; + return convert[dbrType](pstr, pbuffer, NULL); }