From: Joshua Colp Date: Mon, 6 Apr 2009 13:23:12 +0000 (+0000) Subject: Pass the correct value to sizeof when copying address information. X-Git-Tag: 11.0.0-beta1~5119 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9597e33a63781ee3c8e245ee01620275cecc7837;p=thirdparty%2Fasterisk.git Pass the correct value to sizeof when copying address information. (issue #14827) Reported by: pj Patches: 14827.diff uploaded by file (license 11) Tested by: pj git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186563 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/rtp_engine.c b/main/rtp_engine.c index fd448b849b..51f60dcfd8 100644 --- a/main/rtp_engine.c +++ b/main/rtp_engine.c @@ -374,7 +374,7 @@ int ast_rtp_instance_get_local_address(struct ast_rtp_instance *instance, struct if ((address->sin_family != AF_INET) || (address->sin_port != instance->local_address.sin_port) || (address->sin_addr.s_addr != instance->local_address.sin_addr.s_addr)) { - memcpy(address, &instance->local_address, sizeof(address)); + memcpy(address, &instance->local_address, sizeof(*address)); return 1; } @@ -386,7 +386,7 @@ int ast_rtp_instance_get_remote_address(struct ast_rtp_instance *instance, struc if ((address->sin_family != AF_INET) || (address->sin_port != instance->remote_address.sin_port) || (address->sin_addr.s_addr != instance->remote_address.sin_addr.s_addr)) { - memcpy(address, &instance->remote_address, sizeof(address)); + memcpy(address, &instance->remote_address, sizeof(*address)); return 1; }