[asterisk-commits] russell: branch 10 r359072 - in /branches/10: ./ main/features.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Mar 13 19:21:21 CDT 2012


Author: russell
Date: Tue Mar 13 19:21:18 2012
New Revision: 359072

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=359072
Log:
Fix incorrect sizeof() usage in features.c.

This didn't actually result in a bug anywhere, luckily.  The only place
where the result of these memcpys was used is in app_dial, and the only
field that it read out of ast_call_feature was the first one, which is an
int, so these memcpys always copied just enough to avoid a problem.
........

Merged revisions 359069 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/10/   (props changed)
    branches/10/main/features.c

Propchange: branches/10/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/10/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/10/main/features.c?view=diff&rev=359072&r1=359071&r2=359072
==============================================================================
--- branches/10/main/features.c (original)
+++ branches/10/main/features.c Tue Mar 13 19:21:18 2012
@@ -3163,7 +3163,7 @@
 					res = builtin_features[x].operation(chan, peer, config, code, sense, NULL);
 				}
 				if (feature) {
-					memcpy(feature, &builtin_features[x], sizeof(feature));
+					memcpy(feature, &builtin_features[x], sizeof(*feature));
 				}
 				feature_detected = 1;
 				break;
@@ -3193,7 +3193,7 @@
 					if (operation) {
 						res = fge->feature->operation(chan, peer, config, code, sense, fge->feature);
 					}
-					memcpy(feature, fge->feature, sizeof(feature));
+					memcpy(feature, fge->feature, sizeof(*feature));
 					if (res != AST_FEATURE_RETURN_KEEPTRYING) {
 						AST_RWLIST_UNLOCK(&feature_groups);
 						break;
@@ -3226,7 +3226,7 @@
 				res = tmpfeature->operation(chan, peer, config, code, sense, tmpfeature);
 			}
 			if (feature) {
-				memcpy(feature, tmpfeature, sizeof(feature));
+				memcpy(feature, tmpfeature, sizeof(*feature));
 			}
 			if (res != AST_FEATURE_RETURN_KEEPTRYING) {
 				AST_RWLIST_UNLOCK(&feature_list);




More information about the asterisk-commits mailing list