[asterisk-commits] russell: branch 1.8 r359069 - /branches/1.8/main/features.c

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


Author: russell
Date: Tue Mar 13 19:20:21 2012
New Revision: 359069

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=359069
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.

Modified:
    branches/1.8/main/features.c

Modified: branches/1.8/main/features.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/main/features.c?view=diff&rev=359069&r1=359068&r2=359069
==============================================================================
--- branches/1.8/main/features.c (original)
+++ branches/1.8/main/features.c Tue Mar 13 19:20:21 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