Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1000

Creating a new base64 binary does not initialize length to 0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 1.3.0
    • util
    • None

    Description

      I have a scenario where I need to create an empty binary array. I do this by using the following API:

      axutil_base64_binary_t* binary = axutil_base64_binary_create(env);

      The problem that I have is that when I pass this variable to one of my types and then serialize the call to send it out, I get an "Invalid allocation .." exception saying that the allocation size was requested which exceeds the limit of 2GB. I was able to track down the issue to the empty binary. The problem, as the title of this bug indicates, is that the length of the binary is not initialized to zero. Therefore, the error occurs in the API : axutil_base64_binary_get_encoded_binary where a malloc is done which is dependent on the size/length of the binary. Since the length variable is an arbitrary value, I can get the problem outlined before.

      I was able to get around the problem by initializing the binary instead as follows (clearly a workaround):

      usigned char t[1];
      axutil_base64_binary_t* binary = axutil_base64_binary_create_with_plain_binary(env, t, 0);

      Frank

      Attachments

        Activity

          People

            senakafdo Senaka Fernando
            frank@neokast.com Frank Huebbers
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: