[asterisk-dev] [Code Review] 3083: funcs: REPLACE() can call strcpy on overlapping memory
Matt Jordan
reviewboard at asterisk.org
Thu Jan 2 13:08:15 CST 2014
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/3083/#review10508
-----------------------------------------------------------
Ship it!
Ship It!
- Matt Jordan
On Dec. 19, 2013, 2:02 p.m., Scott Griepentrog wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/3083/
> -----------------------------------------------------------
>
> (Updated Dec. 19, 2013, 2:02 p.m.)
>
>
> Review request for Asterisk Developers.
>
>
> Bugs: ASTERISK-22910
> https://issues.asterisk.org/jira/browse/ASTERISK-22910
>
>
> Repository: Asterisk
>
>
> Description
> -------
>
> Patch by: Gareth Palmer
>
> 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.
>
>
> Diffs
> -----
>
> /branches/1.8/funcs/func_strings.c 404386
>
> Diff: https://reviewboard.asterisk.org/r/3083/diff/
>
>
> Testing
> -------
>
>
> Thanks,
>
> Scott Griepentrog
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20140102/b223d03f/attachment.html>
More information about the asterisk-dev
mailing list