Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1600

buffer overrun by patching NUL behind stream buffer

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.6.0
    • 1.7.0
    • core/transport, util, xml/om
    • None

    Description

      In functions axiom_data_source_serialize() and axis2_simple_http_svr_conn_write_respond() the buffer obtained via axutil_stream_get_buffer() and axutil_stream_get_len() is terminated with a NUL byte by patching behind the filled data. If the buffer is exactly full at that time, that NUL is patched into not allocated memory, which may currupt the malloc memory arena (corrupt the heap).

      We have patched "stream.c" to always allocate one more byte than is necessary or used, so that always at least one more byte of memory is allocated. That made our crashes go away.

      A more clean solution would be to have stream.c offer a function that guarantees that additional byte (eventually reallocating), which would be called prior to axutil_stream_get_buffer(), whenever such a NUL byte patching is required.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              marxen Heiner Marxen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - 1h
                  1h
                  Remaining:
                  Remaining Estimate - 1h
                  1h
                  Logged:
                  Time Spent - Not Specified
                  Not Specified