axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carsten Blecken (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Created: (AXISCPP-480) Nonexistent optional primitive elements lead to SEGV on deserialization
Date Fri, 25 Feb 2005 00:30:48 GMT
Nonexistent optional primitive elements lead to SEGV on  deserialization
------------------------------------------------------------------------

         Key: AXISCPP-480
         URL: http://issues.apache.org/jira/browse/AXISCPP-480
     Project: Axis-C++
        Type: Bug
  Components: Client - Stub  
    Versions: 1.5 Alpha    
 Environment: Linux RHEL3
    Reporter: Carsten Blecken
    Priority: Critical


The stub architecture has been changed so that for primitive types (integer, date time) pointers
are used. In case an element is optional a NULL is returned and the resulting *(NULL) leads
to a SEGV.

Consider this stub :

int Axis_DeSerialize_UsageEventColumnType(UsageEventColumnType* param, IWrapperSoapDeSerializer*
pIWSDZ)
{
	param->Event = pIWSDZ->getElementAsString( "Event",0);
	param->Duration = *(pIWSDZ->getElementAsInt("Duration",0));
	param->Date = *(pIWSDZ->getElementAsDateTime( "Date",0));
	return pIWSDZ->getStatus();
}

If either Duration or Count are optional elements (and not present) this will lead to a SEGV.

One way to fix this is to add a NULL check in the stub :

int Axis_DeSerialize_UsageEventColumnType(UsageEventColumnType* param, IWrapperSoapDeSerializer*
pIWSDZ)
{
	param->Event = pIWSDZ->getElementAsString( "Event",0);
        xsd__int * Duration = 0;
        if ((Duration = pIWSDZ->getElementAsInt("Duration",0)) != NULL)
            param->Duration = *Duration;
        xsd_dateTime * Count = 0;
        if ((Count = pIWSDZ->getElementAsDateTime( "Date",0)) != NULL)
	    param->Date = *(pIWSDZ->getElementAsDateTime( "Date",0));

	return pIWSDZ->getStatus();
}




-- 
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