Skip to content
Snippets Groups Projects
Commit fc54891d authored by Brutzman, Don's avatar Brutzman, Don
Browse files

check remaining byte array for PDU bundle, might simply consist of additional padding

parent 00b0255a
No related branches found
No related tags found
No related merge requests found
...@@ -1874,6 +1874,32 @@ public class PduFactory ...@@ -1874,6 +1874,32 @@ public class PduFactory
remaining = Arrays.copyOfRange(data, pduStartPointInData, length); remaining = Arrays.copyOfRange(data, pduStartPointInData, length);
try { try {
// first check remaining byte array for PDU bundle, might simply consist of additional padding
if (remaining.length <= 16)
{
// remaining byte array is too short, smallest PDU is DisPduType 48 ARTICULATED_PARTS, size 17 bytes
// TODO trace capability
// System.out.println("pduBundle remaining byte array is too short for another PDU, length=" + remaining.length);
break;
}
else
{
boolean remainingNonZeroDataFound = false;
for (byte nextByte : remaining)
{
if (nextByte != 0)
{
remainingNonZeroDataFound = true;
continue;
}
}
if (!remainingNonZeroDataFound)
{
// TODO trace capability
// System.out.println("pduBundle remaining byte array (length=" + remaining.length + ") is all zeros, ignored");
break;
}
}
// Decode one PDU // Decode one PDU
pdu = this.createPdu(remaining); pdu = this.createPdu(remaining);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment