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

SetSecure must be changed to use <stdarg.h>

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • current (nightly)
    • None
    • Client - Stub
    • None

    Description

      Currently the generated client stub code for SetSecure is:

      void Service::SetSecure( char * pszArguments, ...)
      {
      char ** ppszArgPtr = &pszArguments;
      int iArgIndex = 0;

      while( *ppszArgPtr != NULL)

      { sArguments[iArgIndex] = *ppszArgPtr; iArgIndex++; ppszArgPtr++; }

      }

      This makes horrible assumptions about how arguments are passed to functions and which direction the stack grows and is highly non-portable.

      The correct code would be:

      #include <stdarg.h>

      void Service::SetSecure( char * pszArguments, ...)
      {
      int iArgIndex = 0;

      va_list args;
      va_start(args, pszArguments);

      while (pszArguments)

      { sArguments[iArgIndex++] = pszArguments; pszArguments = va_arg(args, char*); }

      va_end(args);
      }

      Attachments

        Activity

          People

            prestonf Fred Preston
            tbartley@au1.ibm.com Tim Bartley
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: