Uploaded image for project: 'Axis-C++'
  1. Axis-C++
  2. AXISCPP-967

WSDL2WS generate wrong code: no check for param->any1 will cause core dump

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6 Beta
    • current (nightly)
    • WSDL processing - RPC
    • None

    Description

      [Error Statement]:
      I have used AxisCPP1.6Beta version to generate TestDataInfo.cpp and Respond.cpp as the below:
      TestDataInfo.cpp:
      int Axis_Serialize_JobInfo(JobInfo* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
      {
      ... ...
      pSZ->serializeAnyObject(param->any1);
      ... ...
      }

      and Respond.cpp:
      int Axis_Serialize_Respond(Respond* param, IWrapperSoapSerializer* pSZ, bool bArray = false)
      {
      ... ...
      pSZ->serializeAnyObject(param->any1);
      ... ...
      }

      From the generated code, param->any1 is really an AnyType* pointer.
      In some case, param->any1 will be NULL, but since there has no check for it before use, there will cause my generated server component core dump.

      [solution]:
      I have investigated the source code of AxisCPP/WSDL2Ws tool, and found that if I modify the following code at about line 682~694 in writeSerializeGlobalMethod method that belongs to BeanParamWriter (wsdl2ws/cpp/iteral) class, the generated code will become correct.
      if (attribs[i].isAnyType())
      {
      anyCounter += 1;
      //<mxiong debug 2006/4/25
      writer.write("\tif (param->" + attribs[i].getParamName() + Integer.toString(anyCounter) + " != NULL)\n\t

      {\n"); //>mxiong debug 2006/4/25 writer.write("\t\tpSZ->serializeAnyObject(param->any" + Integer.toString(anyCounter) +");\n"); //<mxiong debug 2006/4/25 writer.write("\t}

      \n");
      //>mxiong debug 2006/4/25
      }

      So I think it maybe a bug, could you like to check it ?

      Attachments

        Activity

          People

            nadiramra Nadir K. Amra
            mxiong Michael Xiong
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: