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 "Mark Whitlock (JIRA)" <ax...@ws.apache.org> on 2004/11/10 16:38:25 UTC

[jira] Created: (AXISCPP-256) SoapFault::setParam fails when xsdtype is not a string

SoapFault::setParam fails when xsdtype is not a string
------------------------------------------------------

         Key: AXISCPP-256
         URL: http://nagoya.apache.org/jira/browse/AXISCPP-256
     Project: Axis-C++
        Type: Bug
  Components: Basic Architecture  
    Reporter: Mark Whitlock
    Priority: Minor


SoapFault::setParam used to copy the value into a fault using strdup which assumes the value is a string (which it normally is). But the value could be any type, so this code will fail (and may sigsegv) for types other than strings. I have recently changed the code to replace strdup's with new's and strcpy's, so that is how I discovered this bug, but as yet I haven't fixed it.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://nagoya.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] Commented: (AXISCPP-256) SoapFault::setParam fails when xsdtype is not a string

Posted by "Dushshantha Chandradasa (JIRA)" <ax...@ws.apache.org>.
    [ http://issues.apache.org/jira/browse/AXISCPP-256?page=comments#action_12317588 ] 

Dushshantha Chandradasa commented on AXISCPP-256:
-------------------------------------------------

As Samisa proposed, SoapFault::setParam() uses a param class method to set values for param.

if (!pParam) return AXIS_FAIL;
    pParam->m_sName = pchName;
    pParam->setValue(type, new String((xsd__string) pValue));
    return AXIS_SUCCESS;

Mark, Is this problem still valid ???

> SoapFault::setParam fails when xsdtype is not a string
> ------------------------------------------------------
>
>          Key: AXISCPP-256
>          URL: http://issues.apache.org/jira/browse/AXISCPP-256
>      Project: Axis-C++
>         Type: Bug
>   Components: SOAP
>     Versions: current (nightly)
>     Reporter: Mark Whitlock
>     Assignee: Dushshantha Chandradasa
>     Priority: Minor
>      Fix For: 1.6 Alpha

>
> SoapFault::setParam used to copy the value into a fault using strdup which assumes the value is a string (which it normally is). But the value could be any type, so this code will fail (and may sigsegv) for types other than strings. I have recently changed the code to replace strdup's with new's and strcpy's, so that is how I discovered this bug, but as yet I haven't fixed it.

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


[jira] Updated: (AXISCPP-256) SoapFault::setParam fails when xsdtype is not a string

Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-256?page=history ]

Samisa Abeysinghe updated AXISCPP-256:
--------------------------------------

        Version: current (nightly)
      Component: SOAP
                     (was: Basic Architecture)
    Fix Version: 1.6 Alpha

> SoapFault::setParam fails when xsdtype is not a string
> ------------------------------------------------------
>
>          Key: AXISCPP-256
>          URL: http://issues.apache.org/jira/browse/AXISCPP-256
>      Project: Axis-C++
>         Type: Bug
>   Components: SOAP
>     Versions: current (nightly)
>     Reporter: Mark Whitlock
>     Priority: Minor
>      Fix For: 1.6 Alpha

>
> SoapFault::setParam used to copy the value into a fault using strdup which assumes the value is a string (which it normally is). But the value could be any type, so this code will fail (and may sigsegv) for types other than strings. I have recently changed the code to replace strdup's with new's and strcpy's, so that is how I discovered this bug, but as yet I haven't fixed it.

-- 
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-256) SoapFault::setParam fails when xsdtype is not a string

Posted by "Dushshantha Chandradasa (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-256?page=all ]
     
Dushshantha Chandradasa closed AXISCPP-256:
-------------------------------------------


> SoapFault::setParam fails when xsdtype is not a string
> ------------------------------------------------------
>
>          Key: AXISCPP-256
>          URL: http://issues.apache.org/jira/browse/AXISCPP-256
>      Project: Axis-C++
>         Type: Bug
>   Components: SOAP
>     Versions: current (nightly)
>     Reporter: Mark Whitlock
>     Assignee: Dushshantha Chandradasa
>     Priority: Minor
>      Fix For: 1.6 Alpha

>
> SoapFault::setParam used to copy the value into a fault using strdup which assumes the value is a string (which it normally is). But the value could be any type, so this code will fail (and may sigsegv) for types other than strings. I have recently changed the code to replace strdup's with new's and strcpy's, so that is how I discovered this bug, but as yet I haven't fixed it.

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


[jira] Commented: (AXISCPP-256) SoapFault::setParam fails when xsdtype is not a string

Posted by "Samisa Abeysinghe (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-256?page=comments#action_61171 ]
     
Samisa Abeysinghe commented on AXISCPP-256:
-------------------------------------------

At the moment SoapFault::setParam() method directly access the Param class attributes and set the value:
e.g. pParam->m_Value.pStrValue = new char[strlen((const char*)pValue)+1];

If we have to solve this problem, we have to be sensitive to the type parameter and set the correct data field of the Param class. However, the best solution would be to deligate the responsibility of setting the data members to Param class itself. Hence we have to add a new method to Param class like:

Param::setValue(const void* pValue, XSDTYPE type)
and call this method from SoapFault::setParam(), rather than trying to address the type issues in SoapFault class

> SoapFault::setParam fails when xsdtype is not a string
> ------------------------------------------------------
>
>          Key: AXISCPP-256
>          URL: http://issues.apache.org/jira/browse/AXISCPP-256
>      Project: Axis-C++
>         Type: Bug
>   Components: SOAP
>     Versions: current (nightly)
>     Reporter: Mark Whitlock
>     Priority: Minor
>      Fix For: 1.6 Alpha

>
> SoapFault::setParam used to copy the value into a fault using strdup which assumes the value is a string (which it normally is). But the value could be any type, so this code will fail (and may sigsegv) for types other than strings. I have recently changed the code to replace strdup's with new's and strcpy's, so that is how I discovered this bug, but as yet I haven't fixed it.

-- 
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] Assigned: (AXISCPP-256) SoapFault::setParam fails when xsdtype is not a string

Posted by "Dushshantha Chandradasa (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-256?page=all ]

Dushshantha Chandradasa reassigned AXISCPP-256:
-----------------------------------------------

    Assign To: Dushshantha Chandradasa

> SoapFault::setParam fails when xsdtype is not a string
> ------------------------------------------------------
>
>          Key: AXISCPP-256
>          URL: http://issues.apache.org/jira/browse/AXISCPP-256
>      Project: Axis-C++
>         Type: Bug
>   Components: SOAP
>     Versions: current (nightly)
>     Reporter: Mark Whitlock
>     Assignee: Dushshantha Chandradasa
>     Priority: Minor
>      Fix For: 1.6 Alpha

>
> SoapFault::setParam used to copy the value into a fault using strdup which assumes the value is a string (which it normally is). But the value could be any type, so this code will fail (and may sigsegv) for types other than strings. I have recently changed the code to replace strdup's with new's and strcpy's, so that is how I discovered this bug, but as yet I haven't fixed it.

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


[jira] Resolved: (AXISCPP-256) SoapFault::setParam fails when xsdtype is not a string

Posted by "Dushshantha Chandradasa (JIRA)" <ax...@ws.apache.org>.
     [ http://issues.apache.org/jira/browse/AXISCPP-256?page=all ]
     
Dushshantha Chandradasa resolved AXISCPP-256:
---------------------------------------------

    Resolution: Fixed

I made the following changes to SoapFault::setParam class to accept any type for pValue. Hope this will solve the problem mentioned in this issue.

int SoapFault::setParam(Param* pParam, const AxisChar* pchName, const void* pValue, XSDTYPE type)
{
    if (!pParam) return AXIS_FAIL;
    pParam->m_sName = pchName;
    pParam->setValue( type , (IAnySimpleType*) pValue);
    return AXIS_SUCCESS;
}

Testing with C++ server side is safe so i clase down the issue.

> SoapFault::setParam fails when xsdtype is not a string
> ------------------------------------------------------
>
>          Key: AXISCPP-256
>          URL: http://issues.apache.org/jira/browse/AXISCPP-256
>      Project: Axis-C++
>         Type: Bug
>   Components: SOAP
>     Versions: current (nightly)
>     Reporter: Mark Whitlock
>     Assignee: Dushshantha Chandradasa
>     Priority: Minor
>      Fix For: 1.6 Alpha

>
> SoapFault::setParam used to copy the value into a fault using strdup which assumes the value is a string (which it normally is). But the value could be any type, so this code will fail (and may sigsegv) for types other than strings. I have recently changed the code to replace strdup's with new's and strcpy's, so that is how I discovered this bug, but as yet I haven't fixed it.

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