Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-2049

memcpy used on overlapping memory regions causes sanity test failure

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.1.2
    • Fix Version/s: 3.2.0, 3.1.3
    • Component/s: Utilities
    • Labels:
      None
    • Environment:
      Debian unstable (sid) and Debian stable (jessie) on amd64

      Description

      On Debian Jessie (libc6 2.19, libstdc++ 4.9.2) and newer, sanityTest.pl fails its tests of XMLString::collapseWS.

      Tracing with GDB shows that XMLString::moveChars is corrupting the string. I think this is likely due to memcpy being used on overlapping memory regions.

      Replacing the memcpy in moveChars with memmove fixes the issue on my systems.

        Attachments

        1. moveChars_overlap.diff
          0.4 kB
          Bill Blough

          Issue Links

            Activity

              People

              • Assignee:
                amassari Alberto Massari
                Reporter:
                billblough Bill Blough
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: