Uploaded image for project: 'Derby'
  1. Derby
  2. DERBY-121

Network Server reading blob/clob data size

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 10.1.1.0
    • 10.1.1.0
    • Network Server
    • None
    • The is a bit shift typo in Network Server reading clob/blob data size

    Description

      in DDMReader.java
      ...
      ... readLengthAndCodePoint() ... {
      ...

      switch (numberOfExtendedLenBytes) {
      case 8:
      ddmScalarLen =
      ((buffer[pos++] & 0xff) << 64) +
      ((buffer[pos++] & 0xff) << 56) +
      ((buffer[pos++] & 0xff) << 48) +
      ((buffer[pos++] & 0xff) << 40) +
      ((buffer[pos++] & 0xff) << 32) +
      ((buffer[pos++] & 0xff) << 16) +
      ((buffer[pos++] & 0xff) << 8) +
      ((buffer[pos++] & 0xff) << 0);
      adjustSize = 12;
      break;
      case 6:
      ddmScalarLen =
      ((buffer[pos++] & 0xff) << 48) +
      ((buffer[pos++] & 0xff) << 40) +
      ((buffer[pos++] & 0xff) << 32) +
      ((buffer[pos++] & 0xff) << 16) +
      ((buffer[pos++] & 0xff) << 8) +
      ((buffer[pos++] & 0xff) << 0);
      adjustSize = 10;
      break;
      case 4:
      ddmScalarLen =
      ((buffer[pos++] & 0xff) << 32) +
      ((buffer[pos++] & 0xff) << 16) +
      ((buffer[pos++] & 0xff) << 8) +
      ((buffer[pos++] & 0xff) << 0);
      adjustSize = 8;
      break;
      ...
      The shift bits should be in order:
      0,8,16,24
      0,8,16,24,32,40
      0,8,16,24,32,40,48,56

      This will only affect a lob if its length requires at least 24 bits--i.e. if the lob has a length of at least 2^24 bytes.

      Attachments

        1. derby-121_2.stat
          1 kB
          A B
        2. derby-121_3.patch
          20 kB
          A B

        Activity

          People

            army A B
            lnguyen Lynh Nguyen
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: