axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From axis-c-...@ws.apache.org
Subject [jira] Created: (AXISCPP-186) The WSDL2WS generated class constructors needs to 'zero' all parameters
Date Tue, 05 Oct 2004 10:09:31 GMT
Message:

  A new issue has been created in JIRA.

---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXISCPP-186

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXISCPP-186
    Summary: The WSDL2WS generated class constructors needs to 'zero' all parameters
       Type: Bug

     Status: Open
   Priority: Major

    Project: Axis-C++
 Components: 
             WSDL generation

   Assignee: Fred Preston
   Reporter: Fred Preston

    Created: Tue, 5 Oct 2004 3:08 AM
    Updated: Tue, 5 Oct 2004 3:08 AM
Environment: n/a

Description:
Summary:
========
The WSDL2WS generated class constructors needs to 'zero' all parameters.

Problem:
========
Currently, the constructor only nulls the class variables that are pointers, i.e.
object.h
--------
ObjectBean* Bean;
ObjectBeanArrayType* BeanArray;
xsd__boolean Boolean;
xsd__base64Binary ByteArray;

object.c
--------
Object::Object()
{
/*do not allocate memory to any pointer members here
 because deserializer will allocate memory anyway. */
Bean=0;
BeanArray=0;
}

If the user does not properly setup the object before serialisation (i.e ByteArray), problems
can occur when the serialiser tries to serialise a bad pointer.

Solution:
=========
By adding additional code to the WSDL2WS code, the constructor can null non-pointer variables
as follows:-
object.c
--------
Object::Object()
{
/*do not allocate memory to any pointer members here
 because deserializer will allocate memory anyway. */
Bean=0;
BeanArray=0;
memset( &Boolean, 0, sizeof( xsd__boolean));
memset( &ByteArray, 0, sizeof( xsd__base64Binary));
}

Thus if the user tries to serialise an object without properly initialising it first, there
will not be any invalid pointers within the object.


---------------------------------------------------------------------
JIRA INFORMATION:
This message is automatically generated by JIRA.

If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message