From b11881d9a3fc3a665f55c837e9c2f8fe1aeed0ca Mon Sep 17 00:00:00 2001 From: Branan Purvine-Riley Date: Tue, 3 Jan 2012 01:18:47 -0800 Subject: [PATCH 1/2] Increase allowable sequence prefix range --- Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp index fda90ee8..691f0fde 100644 --- a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp @@ -316,7 +316,7 @@ plLocation plAgeDescription::CalcPageLocation( const char *page ) const { // Combine our sequence # together Int32 combined; - hsAssert(abs(fSeqPrefix) < 0xFF, "Age sequence prefex is out of range!"); // sequence prefix can NOT be larger or equal to 1-byte max value + hsAssert(fSeqPrefix > -255 && fSeqPrefix <= 0xFEFF, "Age sequence prefex is out of range!"); // sequence prefix can NOT be larger or equal to 1-byte max value UInt32 suffix = ap->GetSeqSuffix(); hsAssert(suffix <= 0xFFFF, "Page sequence number is out of range!"); // page sequence number can NOT be larger then 2-byte max value if( fSeqPrefix < 0 ) // we are a global age From 30faa99367bcc01c76811b1309d64c1368413a59 Mon Sep 17 00:00:00 2001 From: Branan Purvine-Riley Date: Tue, 3 Jan 2012 01:39:15 -0800 Subject: [PATCH 2/2] update comment describing sequence number --- .../Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp index 691f0fde..17dfb385 100644 --- a/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp @@ -326,8 +326,8 @@ plLocation plAgeDescription::CalcPageLocation( const char *page ) const // Now, our 32 bit number looks like the following: // 0xRRAAPPPP - // - RR is FF when reserved, and 00 when normal - // - AA is the one byte for age sequence prefix (FF not allowed because 0xFFFFFFFFFF is reserved for invalid sequence number) + // - RR is FF when reserved, and 00-FE when normal + // - AA is the low byte of the age sequence prefix (FF not allowed on a negative prefix because 0xFFFFFFFFFF is reserved for invalid sequence number) // - PPPP is the two bytes for page sequence number if( IsGlobalAge() )