axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Fred Preston (JIRA)" <axis-c-...@ws.apache.org>
Subject [jira] Closed: (AXISCPP-863) In the stub generated code, an 'OUT' parameter may be null. Before trying to copy the contents a test should be done on the size of the object.
Date Wed, 05 Apr 2006 12:14:18 GMT
     [ http://issues.apache.org/jira/browse/AXISCPP-863?page=all ]
     
Fred Preston closed AXISCPP-863:
--------------------------------


> In the stub generated code, an 'OUT' parameter may be null.  Before trying to copy the
contents a test should be done on the size of the object.
> ------------------------------------------------------------------------------------------------------------------------------------------------
>
>          Key: AXISCPP-863
>          URL: http://issues.apache.org/jira/browse/AXISCPP-863
>      Project: Axis-C++
>         Type: Bug

>   Components: Client - Stub
>  Environment: n/a
>     Reporter: Fred Preston
>      Fix For: 1.6 Alpha

>
> For example:-
> Axis_Array arr2 = m_pCall->getCmplxArray((void*) Axis_DeSerialize_Items,
>                                                                                (void*)
Axis_Create_Items,
>                                                                                (void*)
Axis_Delete_Items,
>                                                                                (void*)
Axis_GetSize_Items,
>                                                                                "Items",
>                                                                                Axis_URI_Items);
> *OutValue1 = (Items_Array&) arr2;
> Becomes:-
> Axis_Array arr2 = m_pCall->getCmplxArray((void*) Axis_DeSerialize_Items,
>                                                                                (void*)
Axis_Create_Items,
>                                                                                (void*)
Axis_Delete_Items,
>                                                                                (void*)
Axis_GetSize_Items,
>                                                                                "Items",
>                                                                                Axis_URI_Items);
> if( arr2.m_Size > 0)
> {
>     *OutValue1 = (Items_Array&) arr2;
> }
> Where an 'if' is used to check that there is data to copy before trying to copy a null
pointer (NB: It is assumed that the pointer to the output parameter passed to the method has
already been set to null by the client application otherwise, on return the client code will
not know if OutValue1 contains valid data).
> OR, to be completely safe...
> if( arr2.m_Size > 0)
> {
>     *OutValue1 = (Items_Array&) arr2;
> }
> else
> {
>     OutValue1->m_Size = 0;
>     OutValue1->m_Array = NULL;
> }

-- 
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
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message