Creating a new base64 binary does not initialize length to 0
------------------------------------------------------------

                 Key: AXIS2C-1000
                 URL: https://issues.apache.org/jira/browse/AXIS2C-1000
             Project: Axis2-C
          Issue Type: Bug
          Components: util
            Reporter: Frank Huebbers


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



-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to