Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
NetworkedGraphicsMV3500
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Savage
NetworkedGraphicsMV3500
Commits
fc54891d
Commit
fc54891d
authored
3 years ago
by
Brutzman, Don
Browse files
Options
Downloads
Patches
Plain Diff
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/edu/nps/moves/dis7/utilities/PduFactory.java
+26
-0
26 additions, 0 deletions
src/edu/nps/moves/dis7/utilities/PduFactory.java
with
26 additions
and
0 deletions
src/edu/nps/moves/dis7/utilities/PduFactory.java
+
26
−
0
View file @
fc54891d
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment