Uploaded image for project: 'Apache Avro'
  1. Apache Avro
  2. AVRO-1523

Perl API: int/long type minimum value checks are off by one

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Patch Available
    • Minor
    • Resolution: Unresolved
    • None
    • 1.9.0
    • perl
    • None
    • Perl: Fix lower bounds of int/long serialization range checks

    Description

      -2,147,483,648 is rejected as an int, and −9,223,372,036,854,775,808 is rejected as a long when passed to the binary encoder, but they are valid signed 32-bit and 64-bit numbers respectively.

      The problem is that the range check is made against the absolute value of the input, but in two's complement arithmetic types the minimum and maximum values have different absolute values.

      Attachments

        1. AVRO-1523.patch
          5 kB
          John Karp

        Activity

          People

            jkarp John Karp
            jkarp John Karp
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: