axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From axis-c-...@ws.apache.org
Subject [jira] Closed: (AXISCPP-107) Memory Access Violation
Date Thu, 09 Sep 2004 03:14:37 GMT
Message:

   The following issue has been closed.

   Resolver: Samisa Abeysinghe
       Date: Wed, 8 Sep 2004 8:12 PM

The buffering has been removed from serializer.
Hence there is no m_pSZBuffers member in serailizer any more.

This this problem would not appear.
---------------------------------------------------------------------
View the issue:
  http://issues.apache.org/jira/browse/AXISCPP-107

Here is an overview of the issue:
---------------------------------------------------------------------
        Key: AXISCPP-107
    Summary: Memory Access Violation
       Type: Bug

     Status: Closed
   Priority: Critical
 Resolution: FIXED

    Project: Axis-C++
 Components: 
             Transport (Client)
   Fix Fors:
             1.3 Beta

   Assignee: 
   Reporter: Robert J. Sanford, Jr.

    Created: Wed, 30 Jun 2004 3:08 PM
    Updated: Wed, 8 Sep 2004 8:12 PM
Environment: Win32 Client compiled using VC++ 6

Description:
I've previously used the Axis Java client code to great success but am now trying to work
through a simple SOAP client in C++ and having great difficulty and am receiving an Access
Violation. Using the Visual C++ debugger I trace the code down into 
  SoapSerializer::operator <<(const AxisChar* cSerialized)

And see that the violation is occuring at:
   strcat((char*)m_pSZBuffers[m_nCurrentBufferIndex].buffer,
   cSerialized);

I am trying to send up an XSD_STRING parameter that is the contents of a file. After escaping
the size of the buffer is just under 11,000 bytes. In digging through the source code it appears
to me that the size of the buffer that the strcat is attempting to go into is 1024 bytes which
will result in an access violation as I ingloriously overwrite memory. I'm guessing this because
previous in the method I see
    int iTmpSerBufferSize = strlen(cSerialized);
    if((m_nFilledSize + iTmpSerBufferSize)>= m_nCurrentBufferSize) 

And m_nCurrentBufferSize is 1024. When SetNextSerializeBuffer is called the next buffer is
allocated at 2048 under the assumption that that will be sufficient. Shortly after that the
call to
   strcat((char*)m_pSZBuffers[m_nCurrentBufferIndex].buffer,
   cSerialized);

Is made using the 2048 byte buffer. Yes, I am using strcat to write 10K worth of data into
a 2K buffer at which point the access violation occurs.

At some point SetNextSerializeBuffer or the code calling SetNextSerializeBuffer will have
to take into account the amount of memory that is actually required by the application.

rjsjr



---------------------------------------------------------------------
JIRA INFORMATION:
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

If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


Mime
View raw message