[PATCH] fix cid 1350010

Volker Lendecke Volker.Lendecke at SerNet.DE
Wed Feb 3 12:39:40 UTC 2016


On Wed, Feb 03, 2016 at 11:32:21AM +0100, Michael Adam wrote:
> From ce60d79e6475b1c4189166bb1a54a2a2c87874f6 Mon Sep 17 00:00:00 2001
> From: Michael Adam <obnox at samba.org>
> Date: Wed, 3 Feb 2016 11:28:32 +0100
> Subject: [PATCH] lib:socket: fix CID 1350010 - integer OVERFLOW_BEFORE_WIDEN
> 
> Signed-off-by: Michael Adam <obnox at samba.org>
> ---
>  lib/socket/interfaces.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/socket/interfaces.c b/lib/socket/interfaces.c
> index 98341e2..f0386c0 100644
> --- a/lib/socket/interfaces.c
> +++ b/lib/socket/interfaces.c
> @@ -160,7 +160,7 @@ static void query_iface_speed_from_name(const char *name, uint64_t *speed)
>  	if (ret == -1) {
>  		goto done;
>  	}
> -	*speed = (ethtool_cmd_speed(&ecmd)) * 1000 * 1000;
> +	*speed = (uint64_t)(ethtool_cmd_speed(&ecmd)) * 1000 * 1000;

Wouldn't ((uint64_t)ethtool_cmd_speed(&ecmd)) be more appropriate?
Just for clarity?

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de



More information about the samba-technical mailing list