message: validate config index range
diff: @@ -345,7 +345,9 @@ bool addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEventStr)
  }
  else
  {
  - config.first[uint64_t(fieldDescriptionObj["Config"])] |= uint64_t(fieldDescriptionObj["DefaultValue"]) << position;
  + const auto cfg = uint64_t(fieldDescriptionObj["Config"]);
  + if (cfg >= config.first.size()) throw std::exception("Config field value is out of bounds");
  + config.first[cfg] |= uint64_t(fieldDescriptionObj["DefaultValue"]) << position;
  }
  }
  else
  @@ -353,7 +355,9 @@ bool addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEventStr)
  std::string fieldValueStr{ eventObj[fieldNameStr].get_c_str() };
  fieldValueStr.erase(std::remove(fieldValueStr.begin(), fieldValueStr.end(), '\"'), fieldValueStr.end());
  // cout << " field value is " << fieldValueStr << " " << read_number(fieldValueStr.c_str()) << "\n";
  - config.first[uint64_t(fieldDescriptionObj["Config"])] |= read_number(fieldValueStr.c_str()) << position;
  + const auto cfg = uint64_t(fieldDescriptionObj["Config"]);
  + if (cfg >= config.first.size()) throw std::exception("Config field value is out of bounds");
  + config.first[cfg] |= read_number(fieldValueStr.c_str()) << position;
  }
  }
  @@ -361,6 +365,7 @@ bool addEventFromDB(PCM::RawPMUConfigs& curPMUConfigs, string fullEventStr)
  {
  const auto pos = int64_t(PMUDeclObj[field]["Position"]);
  const auto cfg = uint64_t(PMUDeclObj[field]["Config"]);
  + if (cfg >= config.first.size()) throw std::exception("Config field value is out of bounds");
  const auto width = uint64_t(PMUDeclObj[field]["Width"]);
  assert (width <= 64);
  const uint64 mask = (width == 64)? (~0ULL) : ((1ULL << width) - 1ULL); // 1 -> 1b, 2 -> 11b, 3 -> 111b
  