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 "Emanuel Norrbin (JIRA)" <ax...@ws.apache.org> on 2006/01/26 01:25:09 UTC

[jira] Commented: (AXISCPP-921) WhatAmI returns reference to local store

    [ http://issues.apache.org/jira/browse/AXISCPP-921?page=comments#action_12364038 ] 

Emanuel Norrbin commented on AXISCPP-921:
-----------------------------------------

The same issue exists in
transport/axis3/HTTPSSLChannel/HTTPSSLChannelInstantiator.cpp
and
transport/axis3/HTTPSSLChannel/HTTPSSLChannelInstantiator.cpp


> 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