Skip to contentSkip to conversation

examples/l2fwd-crypto: fix potential overflow

PATCH Applied Brian Dooley 2 participants 2 messages Feb 21, 2022 – Feb 23, 2022

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 examples/l2fwd-crypto: fix potential overflow

Coverity flags an issue with 32-bit value. If max ethports value is configured with a value larger than 32 there will be an issue. Coverity issue: 375863 Unintentional integer overflow

Fixes 387259bd6c67 ("examples/l2fwd-crypto: add sample application")
---
 examples/l2fwd-crypto/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
examples/l2fwd-crypto/main.c +1 -1
index 4d9f8861af..bbdb263143 100644
@@ -2719,7 +2719,7 @@ initialize_ports(struct l2fwd_crypto_options *options)
 			last_portid = portid;
 		}
 
-		l2fwd_enabled_port_mask |= (1 << portid);
+		l2fwd_enabled_port_mask |= (1ULL << portid);
 		enabled_portcount++;
 	}
 
Signature · 1 line
2.25.1
Acked-by on v1 1/1 Applied
#1 lore raw
Quoted 10 lines

Coverity flags an issue with 32-bit value. If max ethports value is configured with a value larger than 32 there will be an issue. Coverity issue: 375863 Unintentional integer overflow

Fixes 387259bd6c67 ("examples/l2fwd-crypto: add sample application")

---

Applied to dpdk-next-crypto

Thanks.