Uploaded image for project: 'Accumulo'
  1. Accumulo
  2. ACCUMULO-209

RegExFilter does not properly regex when using multi-byte characters

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.5-incubating
    • Fix Version/s: 1.4.0, 1.5.0
    • Component/s: client
    • Labels:
      None

      Description

      The current RegExFilter class uses a ByteArrayBackedCharSequence to set the data to match against. The ByteArrayBackedCharSequence contains a line of code that prevents the matcher from properly matching multi-byte characters.

      Line 49 of ByteArrayBackedCharSequence.java is:
      return (char) (0xff & data[offset + index]);

      This incorrectly casts a single byte from the byte array to a char, which is 2 bytes in Java. This prevents the RegExFilter from properly performing Regular Expressions on multi-byte character encoded values.

      A patch for the RegExFilter.java file has been created and will be submitted.

        Attachments

        1. accumulo-209-RegExFilterTest.patch
          1 kB
          Jim Klucar
        2. accumulo-209-RegExFilter.patch
          4 kB
          Jim Klucar
        3. accumulo-209.patch
          3 kB
          Jim Klucar

          Activity

            People

            • Assignee:
              billie.rinaldi Billie Rinaldi
              Reporter:
              jklucar Jim Klucar
            • Votes:
              2 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - 1h
                1h
                Remaining:
                Remaining Estimate - 1h
                1h
                Logged:
                Time Spent - Not Specified
                Not Specified