axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jake Scott <>
Subject Lack of allocation failure checking in C code gen
Date Wed, 09 Oct 2013 19:07:05 GMT


We are using version 1.6.2 of the Axis2/Java framework to generate C
code for use with Axis2/C, from some WSDL service descriptions.  We have
noticed that the generated code does not always check the return value
of memory allocations, and there is therefore a risk of null pointer
de-references in low memory situations.

For example :

    p_prefix = (axis2_char_t*)AXIS2_MALLOC(env->allocator, sizeof
    sprintf(p_prefix, "n%d", (*next_ns_index)++);

It seems to be generally related to allocations before a call to
sprintf.  Other times the return value is checked :

   _AuthResponse = (adb_AuthResponse_t *) AXIS2_MALLOC(env->allocator,
   if(NULL == _AuthResponse)
     return NULL;

We are certainly willing to patch this and submit back the code, but
before embarking on this effort I'd like to validate this with the
list.  Is this something that would be accepted, and any hints at the
best way to tackle this would be much appreciated.


Jake Scott

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message