From 2957db79b0bd999f6dbfd0173312066d0bbf7917 Mon Sep 17 00:00:00 2001 From: Ville Valpasvuo Date: Wed, 16 Aug 2023 10:24:46 +0300 Subject: [PATCH] Fix placeholder option logic --- src/CoAPNet/Options/OptionFactory.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CoAPNet/Options/OptionFactory.cs b/src/CoAPNet/Options/OptionFactory.cs index 8be5acc..485d7d6 100644 --- a/src/CoAPNet/Options/OptionFactory.cs +++ b/src/CoAPNet/Options/OptionFactory.cs @@ -127,7 +127,7 @@ public CoapOption Create(int number, Stream stream, int length) throw new CoapOptionException($"Unsupported critical option ({number})", new ArgumentOutOfRangeException(nameof(number))); // Return a placeholder option to give the application chance at reading them - option = new CoapOption(number, type: OptionType.Opaque); + option = new CoapOption(number, type: OptionType.Opaque, maxLength: ushort.MaxValue); } option.Decode(stream, length);