Issue Details (XML | Word | Printable)

Key: CORE-3115
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Alexander Peshkov
Reporter: Kovalenko Dmitry
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Firebird Core

Bugs in the internal record compression routines

Created: 23/Aug/10 05:57 AM   Updated: 04/Feb/11 12:15 PM
Component/s: Engine
Affects Version/s: 2.5 RC3
Fix Version/s: 2.5.0, 2.1.4, 2.0.7, 3.0 Alpha 1

Time Tracking:
Not Specified

Planning Status: Unspecified


 Description  « Hide
1. SQZ_decompress

while (input < last)
{
 const int len = (signed char) *input++;

  if (len < 0)
  {
    if(input == last) // <----- !!!
    {
     BUGCHECK(179); //! \todo Use an other BUGCHECK code
     }

    const UCHAR c = *input++;

---------
2. SQZ_differences

while (end1 - rec1 > 2)
{
  if (rec1[0] != rec2[0] || rec1[1] != rec2[1])
  {
   p = out++;
   /* cast this to LONG to take care of OS/2 pointer arithmetic
       when rec1 is at the end of a segment, to avoid wrapping around */

   const SCHAR* yellow = (SCHAR *) MIN((U_IPTR) end1, ((U_IPTR) rec1 + 127)) - 1;

   while ( (rec1 <= yellow && rec1[0] != rec2[0]) ||
                (/*1*/ rec1 < yellow /*1*/ && /*2*/ rec1[1] != rec2[1] /*2*/) ) // <----- !!!
   {


 All   Comments   Work Log   Change History   Version Control   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Alexander Peshkov added a comment - 23/Aug/10 10:09 AM
Issue appears to be critical, cause it can in rare cases make firebird terminate due to access violation.

Kovalenko Dmitry added a comment - 23/Sep/10 08:15 AM
Please, apply these changes to
- Compressor::unpack
- Compressor::makeDiff

Alexander Peshkov added a comment - 14/Oct/10 11:46 AM
Reopening for front- and backporting