[asterisk-commits] russell: trunk r359075 - in /trunk: ./ main/features.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Mar 13 19:22:12 CDT 2012
Author: russell
Date: Tue Mar 13 19:22:10 2012
New Revision: 359075
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=359075
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
........
Merged revisions 359072 from http://svn.asterisk.org/svn/asterisk/branches/10
Modified:
trunk/ (props changed)
trunk/main/features.c
Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-10-merged' - no diff available.
Modified: trunk/main/features.c
URL: http://svnview.digium.com/svn/asterisk/trunk/main/features.c?view=diff&rev=359075&r1=359074&r2=359075
==============================================================================
--- trunk/main/features.c (original)
+++ trunk/main/features.c Tue Mar 13 19:22:10 2012
@@ -3176,7 +3176,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;
@@ -3206,7 +3206,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;
@@ -3239,7 +3239,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