Skip to content

Commit f170c02

Browse files
committed
correcting size calculation for raw bytes
1 parent 423f021 commit f170c02

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/dds.net-connector-csharp.lib/DdsConnector-PP.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ private void ParseVariablesUpdateFromServer(ref byte[] data, ref int offset)
188188
//-
189189
//- Not enough data is available
190190
//-
191-
if (totalBytes + offset >= data.Length)
191+
if (totalBytes + offset > data.Length)
192192
{
193193
if (var != null)
194194
{

src/dds.net-connector-csharp.lib/Types/Variables/RawBytes/RawBytesVariable.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public override void WriteSubTypeOnBuffer(ref byte[] buffer, ref int offset)
111111

112112
public override void WriteValueOnBuffer(ref byte[] buffer, ref int offset)
113113
{
114-
if (offset + GetValueSizeOnBuffer() >= buffer.Length)
114+
if (offset + GetValueSizeOnBuffer() > buffer.Length)
115115
{
116116
throw new Exception(
117117
$"Cannot fit {GetValueSizeOnBuffer()} bytes " +

0 commit comments

Comments
 (0)