diff options
author | Scott Griepentrog <sgriepentrog@digium.com> | 2014-01-02 19:38:09 +0000 |
---|---|---|
committer | Scott Griepentrog <sgriepentrog@digium.com> | 2014-01-02 19:38:09 +0000 |
commit | ff02c8e254f4836a66363b981ad7d956fbaaf565 (patch) | |
tree | 9feb41162c4068444b5707b4e9f0c67bcb782c59 /funcs/func_sha1.c | |
parent | 821ab5138118b36c95f80ea0a54c4b6457a4f572 (diff) |
func_strings: use memmove to prevent overlapping memory on strcpy
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 arguments 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.
(closes issue ASTERISK-22910)
Reported by: Gareth Palmer
Review: https://reviewboard.asterisk.org/r/3083/
Patches:
func_strings.patch uploaded by Gareth Palmer (license 5169)
........
Merged revisions 404674 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 404675 from http://svn.asterisk.org/svn/asterisk/branches/11
........
Merged revisions 404676 from http://svn.asterisk.org/svn/asterisk/branches/12
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@404677 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'funcs/func_sha1.c')
0 files changed, 0 insertions, 0 deletions