Uploaded image for project: 'IMPALA'
  1. IMPALA
  2. IMPALA-12986

Base64Encode fails if the 'out_len' output parameter is passed with certain values

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • None
    • Backend
    • None
    • ghx-label-13

    Description

      The Base64Encode function in coding-util.h with signature 

      bool Base64Encode(const char* in, int64_t in_len, int64_t out_max, char* out, int64_t* out_len);

      fails if '*out_len', when passed to the function, contains a negative value or a value that does not fit in a 32 bit integer.

      Internally we use the 
       

      int sasl_encode64(const char *in, unsigned inlen, char *out, unsigned outmax, unsigned *outlen);

       
      function and explicitly cast 'out_len' to 'unsigned*'.

      The success of this function shouldn't depend on the value of '*out_len' because it is an output parameter, so we should set '*out_len' to zero before passing it to sasl_encode64().

      Attachments

        Activity

          People

            daniel.becker Daniel Becker
            daniel.becker Daniel Becker
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: