From 50146892b9e81cf981e353487e1c75d7d5344504 Mon Sep 17 00:00:00 2001 From: eugene-hong <58686228+eugene-doobu@users.noreply.github.com> Date: Mon, 21 Oct 2024 15:43:55 +0900 Subject: [PATCH] update message pack to 2.5.187 --- .../Formatters/ExceptionFormatter.cs | 18 +++++++++++++++++- Lib9c.MessagePack/Lib9c.MessagePack.csproj | 6 +++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Lib9c.MessagePack/Formatters/ExceptionFormatter.cs b/Lib9c.MessagePack/Formatters/ExceptionFormatter.cs index 481f1f7fb5..5cedaef121 100644 --- a/Lib9c.MessagePack/Formatters/ExceptionFormatter.cs +++ b/Lib9c.MessagePack/Formatters/ExceptionFormatter.cs @@ -55,13 +55,29 @@ public void Serialize(ref MessagePackWriter writer, T? value, for (int i = 0; i < count; i++) { var name = reader.ReadString(); + if (name == null) + { + throw new MessagePackSerializationException("Exception Name is missing."); + } + if (name == "ExceptionType") { typeName = reader.ReadString(); } else { - var type = Type.GetType(reader.ReadString()); + var readType = reader.ReadString(); + if (readType == null) + { + throw new MessagePackSerializationException("Exception type information is missing."); + } + + var type = Type.GetType(readType); + if (type == null) + { + throw new MessagePackSerializationException("Exception type information is missing."); + } + var value = MessagePackSerializer.Deserialize(type, ref reader, options); info.AddValue(name, value); } diff --git a/Lib9c.MessagePack/Lib9c.MessagePack.csproj b/Lib9c.MessagePack/Lib9c.MessagePack.csproj index de51061462..6b5a8ee0e3 100644 --- a/Lib9c.MessagePack/Lib9c.MessagePack.csproj +++ b/Lib9c.MessagePack/Lib9c.MessagePack.csproj @@ -12,9 +12,9 @@ - - - + + + runtime; build; native; contentfiles; analyzers all