From f3428938dfe7bb82fa6e5356febbb729edc0cb27 Mon Sep 17 00:00:00 2001 From: Brad Gonzales Date: Mon, 6 May 2013 17:40:39 -0500 Subject: [PATCH] Issue #1979 Fix Redbook frame issue parsing redbook data with a default header at the end of the buffer. Change-Id: I30d89f84bbecf3250f491106b337c9c12ec88bb9 Former-commit-id: 13c449eb5d30231f15264aca01c5a773be92208a [formerly 90e1c8b65baad0af8f8a7a27b6b308b504c1be27] Former-commit-id: b0f07f4a83084c6b812e9626dd9abb5291c4a410 --- .../edex/plugin/redbook/common/blocks/RedbookBlock.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/common/blocks/RedbookBlock.java b/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/common/blocks/RedbookBlock.java index b9c7af7265..72accd5c56 100644 --- a/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/common/blocks/RedbookBlock.java +++ b/edexOsgi/com.raytheon.edex.plugin.redbook/src/com/raytheon/edex/plugin/redbook/common/blocks/RedbookBlock.java @@ -37,6 +37,7 @@ import org.apache.commons.logging.LogFactory; * 20080512 1131 jkorman Initial implementation. * Apr 29, 2013 1958 bgonzale Added class RedbookBlockHeader, * and nested Factory interface. + * May 06, 2013 1979 bgonzale Catch Header at the end of buffer. * * * @@ -76,7 +77,7 @@ public abstract class RedbookBlock { this.header = header; - hasLength = (this.header.hdr & LEN_MASK) == 0; + hasLength = ((this.header.hdr & LEN_MASK) == 0 && data.hasRemaining()); hasChkSum = (this.header.hdr & CHKSUM_MASK) == 0;