dlsantos / dnp3

Automatically exported from code.google.com/p/dnp3
0 stars 0 forks source link

IndexWriteIterator produces incorrect frames for 4Byte index mode #27

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The increment operator for IndexedWriteIterator uses the enum
IndexMode to determine how many bytes to increment the pointer.  If
the index size is IM_NONE, IM_1B, or IM_2B, the pointer is incremented
the correct 0, 1, or two bytes respectively.  If the index size is 4
bytes, the pointer is only moved three bytes since the value of IM_4B
is 3.  Here's a possible fix:

enum IndexMode
{
IM_NONE = 0,
IM_1B = 1,
IM_2B = 2,
IM_4B = 4
}

Original issue reported on code.google.com by jadamcrain on 3 Oct 2011 at 2:19

GoogleCodeExporter commented 9 years ago

Original comment by jadamcrain on 3 Oct 2011 at 2:19