From: Russell Bryant Date: Wed, 14 Mar 2012 00:20:21 +0000 (+0000) Subject: Fix incorrect sizeof() usage in features.c. X-Git-Tag: 1.8.10.1~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=48b1c5e5a68296ffa6371ba724a1a8ecf1a1d850;p=thirdparty%2Fasterisk.git 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. git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@359069 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/features.c b/main/features.c index b86d7f94f0..75612cf3c6 100644 --- a/main/features.c +++ b/main/features.c @@ -3163,7 +3163,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; @@ -3193,7 +3193,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; @@ -3226,7 +3226,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);