mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-05 04:11:08 +00:00
Use memmove() instead of memcpy() for a case where the buffers overlap.
Once again, valgrind is freaking awesome. That is all. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -2927,7 +2927,7 @@ static const char *ast_str_substring(struct ast_str *value, int offset, int leng
|
|||||||
|
|
||||||
if (offset > 0) {
|
if (offset > 0) {
|
||||||
/* Go ahead and chop off the beginning */
|
/* Go ahead and chop off the beginning */
|
||||||
memcpy(ast_str_buffer(value), ast_str_buffer(value) + offset, ast_str_strlen(value) - offset + 1);
|
memmove(ast_str_buffer(value), ast_str_buffer(value) + offset, ast_str_strlen(value) - offset + 1);
|
||||||
lr -= offset;
|
lr -= offset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user