[ http://issues.apache.org/jira/browse/AXISCPP-284?page=all ] Fred Preston closed AXISCPP-284: --------------------------------
> Problem returning a pointer with c_str() to an unnamed string object in > SimpleAxisTransport.cpp > ----------------------------------------------------------------------------------------------- > > Key: AXISCPP-284 > URL: http://issues.apache.org/jira/browse/AXISCPP-284 > Project: Axis-C++ > Type: Bug > Versions: 1.3 Final > Environment: Windows > Reporter: Samisa Abeysinghe > Assignee: Samisa Abeysinghe > Fix For: 1.4 Alpha > > On Wed, 24 Nov 2004, Steve Hardy wrote: > > Hey there, > > > > I was looking at why axis doesn't want te run on my win32 platform, > and > > came across the following (bad) problem: > > > > SimpleAxisTransport.cpp, line 244: > > > > return m_strSOAPAction.substr(uiOpStart, > > m_strSOAPAction.length () - > > uiOpStart).c_str(); > > > > This is a *bad thing* because you are returning a pointer with > c_str() > to > > an unnamed string object (the one returned by substr) which is out of > > context when you return the function. This seems to work in linux, > (as > > long as the stack isn't clobbered), but in windows this fails in > debug > > mode for sure, and probably in release mode too (MSVC++ 6.0). > > > > I'd recommend recoding this to returning a string object or having a > > c_str() pointer from the m_strSOAPAction object as this doesn't go > out > of > > context. > > > > Yours, > > Steve Hardy > And the same problem on line 230 with m_strServiceURI > fixing these two problems (and using Xerces, expat didn't seem to > work), > fixes the simpleserver on win32. -- 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
