Avro
  1. Avro
  2. AVRO-980

C: avro_schema_from_json ignores length parameter

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 1.6.1
    • Fix Version/s: 1.6.2
    • Component/s: c
    • Labels:
    • Environment:

      Linux x86_64 (Ubuntu 11.10)
      Avro 1.6.1
      GCC 4.6.1
      cmake 2.8.5

      Description

      The function avro_schema_from_json() takes in a const char* and a length parameter, but it appears that the length parameter is ignored.

      We have a project where the schema is a binary resource compiled into the executable, and is not guaranteed to have a null terminator at the end.
      This did not appear to be an issue because the function had a length parameter.

      The other day, It kept throwing errors about characters that were not in the file at all.
      Suspecting it was running off the end of the file, I had a look at the Avro-C code and found that even though the function takes in a length parameter, it does not use it and expects a null terminator.

        Activity

        Michael Cooper created issue -
        Douglas Creager made changes -
        Field Original Value New Value
        Attachment 0001-AVRO-980.-C-Handle-length-parameter-in-avro_schema_f.patch [ 12508030 ]
        Douglas Creager made changes -
        Douglas Creager made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.6.2 [ 12319074 ]
        Resolution Fixed [ 1 ]
        Doug Cutting made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

          • Assignee:
            Unassigned
            Reporter:
            Michael Cooper
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development