From db654cd149dfd4031873947c49caac93604c237a Mon Sep 17 00:00:00 2001
From: Botond Baranyi <botond.baranyi@ericsson.com>
Date: Wed, 11 Nov 2020 12:55:01 +0100
Subject: [PATCH] Added the previous JSON decoder fix for RT2 aswell (bug
 568645)

Signed-off-by: Botond Baranyi <botond.baranyi@ericsson.com>
Change-Id: Ide8b2e74c86ad29fa1fc6e6ad1889239e9ee26df
---
 core2/Basetype2.cc | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/core2/Basetype2.cc b/core2/Basetype2.cc
index 3839dc55c..bb0401b77 100644
--- a/core2/Basetype2.cc
+++ b/core2/Basetype2.cc
@@ -6301,6 +6301,9 @@ int Record_Type::JSON_decode(const TTCN_Typedescriptor_t& p_td, JSON_Tokenizer&
       }
       if (field_count == field_idx) {
         // invalid field name
+        if (p_silent) {
+          return JSON_ERROR_INVALID_TOKEN;
+        }
         JSON_ERROR(TTCN_EncDec::ET_INVAL_MSG, is_metainfo ?
           JSON_DEC_METAINFO_NAME_ERROR : JSON_DEC_INVALID_NAME_ERROR, (int)name_len, name);
         // if this is set to a warning, skip the value of the field
-- 
GitLab