You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-dev@axis.apache.org by "Carsten Blecken (JIRA)" <ax...@ws.apache.org> on 2005/02/25 01:30:48 UTC
[jira] Created: (AXISCPP-480) Nonexistent optional primitive elements lead to SEGV on deserialization
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
[jira] Closed: (AXISCPP-480) Nonexistent optional primitive elements lead to SEGV on deserialization
Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
[ http://issues.apache.org/jira/browse/AXISCPP-480?page=history ]
Samisa Abeysinghe closed AXISCPP-480:
-------------------------------------
Resolution: Fixed
Fix Version: 1.5 Final
Closing this out as Carsten has fixed this issue
> 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
> Fix For: 1.5 Final
>
> 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