Skip to content

Commit df49e34

Browse files
committed
correcting size calculation for raw bytes
1 parent 666cade commit df49e34

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/dds.net-server.lib/Core/Internal/IOProcessor/Types/Variable/RawBytesVariable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public override void WriteValueOnBuffer(ref byte[] buffer, ref int offset)
112112
//- So, we only write the internal data.
113113
//-
114114

115-
if (offset + GetValueSizeOnBuffer() >= buffer.Length)
115+
if (offset + GetValueSizeOnBuffer() > buffer.Length)
116116
{
117117
throw new Exception(
118118
$"Cannot fit {GetValueSizeOnBuffer()} bytes " +

src/dds.net-server.lib/Core/Internal/IOProcessor/VariablesDatabase-Database.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ private bool AssignVariableWithValue(
546546

547547
if (totalBytes > 0)
548548
{
549-
if (totalBytes + offset >= data.Length)
549+
if (totalBytes + offset > data.Length)
550550
{
551551
throw new Exception($"Insufficient data provided for {rawBytesVariable.Name}");
552552
}

0 commit comments

Comments
 (0)