|
@@ -2259,6 +2259,9 @@ searchObjectForKeyRec(const char *searchKey, CtxJson *ctx,
|
|
|
if(jsoneq((char*)ctx->pos, &parseCtx->tokenArray[parseCtx->index], searchKey) == 0) {
|
|
|
/*found*/
|
|
|
parseCtx->index++; /*We give back a pointer to the value of the searched key!*/
|
|
|
+ if (parseCtx->index >= parseCtx->tokenCount)
|
|
|
+ /* We got invalid json. See https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=14620 */
|
|
|
+ return UA_STATUSCODE_BADOUTOFRANGE;
|
|
|
*resultIndex = parseCtx->index;
|
|
|
return UA_STATUSCODE_GOOD;
|
|
|
}
|