Add validation of string lengths (#1718)

This commit is contained in:
Christian
2023-05-01 12:03:23 +02:00
committed by GitHub
parent 4b7d035e9e
commit 0e815c626c
9 changed files with 65 additions and 46 deletions
@@ -24,10 +24,10 @@ namespace MQTTnet.Tests
writer.WriteString("1234567890");
Assert.AreEqual(10 + 2, writer.Length);
writer.WriteBinaryData(new byte[300]);
writer.WriteBinary(new byte[300]);
Assert.AreEqual(300 + 2 + 12, writer.Length);
writer.WriteBinaryData(new byte[5000]);
writer.WriteBinary(new byte[5000]);
Assert.AreEqual(5000 + 2 + 300 + 2 + 12, writer.Length);
}
}