commit | 7796c11275aa77a5af2574b91fc291dc7c36718d | [log] [tgz] |
---|---|---|
author | Charles Chan <rascov@gmail.com> | Mon Apr 02 17:54:03 2018 -0700 |
committer | Charles Chan <charles@opennetworking.org> | Tue Apr 03 18:21:39 2018 +0000 |
tree | 68fa8b23966382a3eda325a32e33dedf9e29d61b | |
parent | 4ffd6aeb181033e6c9a96c62250c63414a1c02b3 [diff] |
Fix deserialization exception caused by miscalculation of TCP offset Change-Id: Ibe6be12f850463fc0c3029d00b8dca20982bca75
diff --git a/utils/misc/src/main/java/org/onlab/packet/TCP.java b/utils/misc/src/main/java/org/onlab/packet/TCP.java index 735a415..410be78 100644 --- a/utils/misc/src/main/java/org/onlab/packet/TCP.java +++ b/utils/misc/src/main/java/org/onlab/packet/TCP.java
@@ -416,7 +416,7 @@ tcp.urgentPointer = bb.getShort(); if (tcp.dataOffset > 5) { int optLength = (tcp.dataOffset << 2) - 20; - checkHeaderLength(length, TCP_HEADER_LENGTH + tcp.dataOffset); + checkHeaderLength(length, TCP_HEADER_LENGTH + optLength); tcp.options = new byte[optLength]; bb.get(tcp.options, 0, optLength); }