* [PATCH] app/testpmd: fix integer overflow
@ 2017-10-19 9:38 Jasvinder Singh
2017-10-23 18:53 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Jasvinder Singh @ 2017-10-19 9:38 UTC (permalink / raw)
To: dev
Fixed integer overflow by casting link_params.link_speed to
uint64_t type.
CID 195016 (#1 of 1): Unintentional integer overflow
(OVERFLOW_BEFORE_WIDEN)
Fixes: 5b590fbe09b6 ("app/testpmd: add traffic management forwarding mode")
Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
---
app/test-pmd/tm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/test-pmd/tm.c b/app/test-pmd/tm.c
index da1adda..dd837cb 100644
--- a/app/test-pmd/tm.c
+++ b/app/test-pmd/tm.c
@@ -335,7 +335,7 @@ set_tm_hiearchy_nodes_shaper_rate(portid_t port_id, struct tm_hierarchy *h)
memset(&link_params, 0, sizeof(link_params));
rte_eth_link_get(port_id, &link_params);
- tm_port_rate = link_params.link_speed * BYTES_IN_MBPS;
+ tm_port_rate = (uint64_t)link_params.link_speed * BYTES_IN_MBPS;
if (tm_port_rate > UINT32_MAX)
tm_port_rate = UINT32_MAX;
--
2.9.3
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] app/testpmd: fix integer overflow
2017-10-19 9:38 [PATCH] app/testpmd: fix integer overflow Jasvinder Singh
@ 2017-10-23 18:53 ` Ferruh Yigit
2017-10-23 18:59 ` Ferruh Yigit
0 siblings, 1 reply; 3+ messages in thread
From: Ferruh Yigit @ 2017-10-23 18:53 UTC (permalink / raw)
To: Jasvinder Singh, dev
On 10/19/2017 2:38 AM, Jasvinder Singh wrote:
> Fixed integer overflow by casting link_params.link_speed to
> uint64_t type.
Coverity Issue: 195016> Fixes: 5b590fbe09b6 ("app/testpmd: add traffic
management forwarding mode")
>
> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] app/testpmd: fix integer overflow
2017-10-23 18:53 ` Ferruh Yigit
@ 2017-10-23 18:59 ` Ferruh Yigit
0 siblings, 0 replies; 3+ messages in thread
From: Ferruh Yigit @ 2017-10-23 18:59 UTC (permalink / raw)
To: Jasvinder Singh, dev
On 10/23/2017 11:53 AM, Ferruh Yigit wrote:
> On 10/19/2017 2:38 AM, Jasvinder Singh wrote:
>> Fixed integer overflow by casting link_params.link_speed to
>> uint64_t type.
>
> Coverity Issue: 195016> Fixes: 5b590fbe09b6 ("app/testpmd: add traffic
> management forwarding mode")
>>
>> Signed-off-by: Jasvinder Singh <jasvinder.singh@intel.com>
>
> Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>
Applied to dpdk-next-net/master, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-23 18:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-19 9:38 [PATCH] app/testpmd: fix integer overflow Jasvinder Singh
2017-10-23 18:53 ` Ferruh Yigit
2017-10-23 18:59 ` Ferruh Yigit
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.