WhatAmI returns reference to local store
----------------------------------------

         Key: AXISCPP-921
         URL: http://issues.apache.org/jira/browse/AXISCPP-921
     Project: Axis-C++
        Type: Bug
  Components: Transport (axis3)  
    Versions:  1.6 Final    
 Environment: All platforms, Issue found in nightly drop 24-Jan-2006 21:23
    Reporter: Emanuel Norrbin


File: transport\axis3\HTTPTransportInstantiator.cpp
Method: const char * WhatAmI()
Line: 79 - 94

The method below returns a reference to the locally allocated string 
szWhatAmI[256],
if a char* is to be returned it has to be allocated globally or the program 
might crash
when this memory is acessed by the caller.

   STORAGE_CLASS_INFO const char * WhatAmI()
        {
                char                    szInfo[64];
                char                    szWhatAmI[256];
                const char *    pszWhatAmI = szWhatAmI;   //** Local store

                memset( szInfo, 0, sizeof( szInfo));
                memset( szWhatAmI, 0, sizeof( szWhatAmI));

                strcpy( szWhatAmI, "LibraryName: HTTPTransport\n");

#ifdef WIN32
                sprintf( szInfo, "Built: %s\n", __TIMESTAMP__);
                strcat( szWhatAmI, szInfo);
#endif
                return pszWhatAmI;  //** Returns reference to local store!!
        }


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

Reply via email to