summaryrefslogtreecommitdiff
path: root/main/features.c
diff options
context:
space:
mode:
authorRussell Bryant <russell@russellbryant.com>2012-03-14 00:22:10 +0000
committerRussell Bryant <russell@russellbryant.com>2012-03-14 00:22:10 +0000
commit9410f856996547eb49a932d878cdd5eddc221966 (patch)
treedd0b881d0d200bbed902047c6e30fa91f1054f11 /main/features.c
parent1b3cbdacd7aaca2bf25113f412bc0b5f5c7bcef4 (diff)
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 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/features.c')
-rw-r--r--main/features.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/main/features.c b/main/features.c
index 44c937692..97d17bbee 100644
--- a/main/features.c
+++ b/main/features.c
@@ -3176,7 +3176,7 @@ static int feature_interpret_helper(struct ast_channel *chan, struct ast_channel
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 @@ static int feature_interpret_helper(struct ast_channel *chan, struct ast_channel
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 @@ static int feature_interpret_helper(struct ast_channel *chan, struct ast_channel
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);