axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Florian Steinborn (JIRA)" <j...@apache.org>
Subject [jira] Created: (AXIS2C-628) c-server stubs: memset missing
Date Tue, 26 Jun 2007 17:45:25 GMT
c-server stubs: memset missing
------------------------------

                 Key: AXIS2C-628
                 URL: https://issues.apache.org/jira/browse/AXIS2C-628
             Project: Axis2-C
          Issue Type: Improvement
          Components: code generation
         Environment: Linux V. 10.0, Apache Axis2 SNAPSHOT build May 16th, 2007
            Reporter: Florian Steinborn


I raised this JIRA first under the Axis2 topic (as I thought generation takes place there)
but it was rejected and I was asked to re-JIRA it here.

#######################################

I guess I found a problem in generated sources. I try to get in touch with Axis and play around
with all the things... I have a service that returns an array of structures that contain all
possible datatypes - also float and double. 
  
I used this class for generating the wsdl: 
  
  
public class Dat{ 
    public long l; 
    public short s; 
    public int i; 
    public String str; 
    public float fl; 
    public double dl; 
} 
  
The generated wsdl shows 
  
<xs:element name="Dat" type="ns:Dat" /> 
<xs:complexType name="Dat"> 
<xs:sequence> 
<xs:element name="dl" type="xs:double" /> 
<xs:element name="fl" type="xs:float" /> 
<xs:element name="i" type="xs:int" /> 
<xs:element name="str" nillable="true" type="xs:string" /> 
<xs:element name="l" type="xs:long" /> 
<xs:element name="s" type="xs:short" /> 
</xs:sequence> 
</xs:complexType> 
  
When you generate C-Server stubs the constructor function 
shows: 
  
AXIS2_EXTERN axis2_Dat_t* AXIS2_CALL 
axis2_Dat_create( 
    const axutil_env_t *env ) 
{ 
    axis2_Dat_t *Dat = NULL; 
  
    AXIS2_ENV_CHECK(env, NULL); 
  
    Dat = (axis2_Dat_t *) AXIS2_MALLOC(env-> 
        allocator, sizeof(axis2_Dat_t)); 
  
    /* *********** missing *********** 
     * memset( Dat, 0, sizeof(axis2_Dat_t)); 
     * ******************************** 
     */ 
  
    if(NULL == Dat) 
    { 
        AXIS2_ERROR_SET(env->error, AXIS2_ERROR_NO_MEMORY, AXIS2_FAILURE); 
        return NULL; 
    } 
    return Dat; 
} 
  
For more safety it would be desirable if the generation would add the memset() call. Alternatively
it could be possible to use an allocation method that leaves the allocated memory initialized....
(calloc() ?)

-- 
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: axis-c-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-c-dev-help@ws.apache.org


Mime
View raw message