[asterisk-bugs] [JIRA] (ASTERISK-22915) [patch] - REPLACE() calls strcpy on overlapping memory when <replace-char> is empty

Matt Jordan (JIRA) noreply at issues.asterisk.org
Tue Nov 26 12:08:03 CST 2013


Matt Jordan created ASTERISK-22915:
--------------------------------------

             Summary: [patch] - REPLACE() calls strcpy on overlapping memory when <replace-char> is empty
                 Key: ASTERISK-22915
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-22915
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Functions/func_strings
    Affects Versions: 11.6.0, 12.0.0-beta2
            Reporter: Gareth Palmer
            Severity: Minor


When calling REPLACE() with an empty replace-char argument; strcpy is used to overwrite the the matching <find-char>.

However as the src and dest argument to strcpy must not overlap it causes other parts of the string to be overwritten with adjacent characters and the result is mangled.

Patch replaces call to strcpy with memmove and adds a test suite case for REPLACE.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.asterisk.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list