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

Gareth Palmer (JIRA) noreply at issues.asterisk.org
Mon Nov 25 19:12:03 CST 2013


Gareth Palmer created ASTERISK-22910:
----------------------------------------

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

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