Uploaded image for project: 'WiredTiger'
  1. WiredTiger
  2. WT-1985

Java binding doesn't encode the integer 8256 correctly

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Critical - P2 Critical - P2
    • WT2.7.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Since 2.5.0, the C library makes a special case for encoding the integer value "8256" which is (2^13 + 2^16). The java library doesn't make the same special case, so it is possible to corrupt the database state by writing that value into it (see attached test case).

      Were there and special precautions that WiredTiger takes when upgrading versions that going from 2.4 -> 2.5 re-encoded any values that changed? How would similar encoding changes in the future be handled?

      Why doesn't the java binding use the C wiredtiger_struct_pack instead of reimplementing the same algorithm? At a very quick glance it looks like the python binding does the same thing, so it is likely similarly affected.

        1. IntegerPackingBug.java
          1.0 kB
          Greg Rogers

            Assignee:
            donald.anderson@mongodb.com Donald Anderson
            Reporter:
            grogers Greg Rogers
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: