[asterisk-commits] russell: trunk r245610 - /trunk/main/pbx.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 8 17:23:46 CST 2010


Author: russell
Date: Mon Feb  8 17:23:45 2010
New Revision: 245610

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=245610
Log:
Use memmove() instead of memcpy() for a case where the buffers overlap.

Once again, valgrind is freaking awesome.  That is all.

Modified:
    trunk/main/pbx.c

Modified: trunk/main/pbx.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/pbx.c?view=diff&rev=245610&r1=245609&r2=245610
==============================================================================
--- trunk/main/pbx.c (original)
+++ trunk/main/pbx.c Mon Feb  8 17:23:45 2010
@@ -2927,7 +2927,7 @@
 
 	if (offset > 0) {
 		/* 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;
 	}
 




More information about the asterisk-commits mailing list