lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241007163812.499944-1-stephen@networkplumber.org>
Date: Mon,  7 Oct 2024 09:38:04 -0700
From: Stephen Hemminger <stephen@...workplumber.org>
To: netdev@...r.kernel.org
Cc: Stephen Hemminger <stephen@...workplumber.org>
Subject: [PATCH iproute] netem: swap transposed calloc args

Gcc with -Wextra complains about transposed args to calloc
in netem.

Signed-off-by: Stephen Hemminger <stephen@...workplumber.org>
---
 tc/q_netem.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tc/q_netem.c b/tc/q_netem.c
index 90b26136..c48fde11 100644
--- a/tc/q_netem.c
+++ b/tc/q_netem.c
@@ -414,7 +414,7 @@ random_loss_model:
 			}
 		} else if (matches(*argv, "distribution") == 0) {
 			NEXT_ARG();
-			dist_data = calloc(sizeof(dist_data[0]), MAX_DIST);
+			dist_data = calloc(MAX_DIST, sizeof(dist_data[0]));
 			if (dist_data == NULL)
 				return -1;
 
@@ -479,7 +479,7 @@ random_loss_model:
 				if (strcmp(*argv, "distribution") == 0) {
 					present[TCA_NETEM_SLOT] = 1;
 					NEXT_ARG();
-					slot_dist_data = calloc(sizeof(slot_dist_data[0]), MAX_DIST);
+					slot_dist_data = calloc(MAX_DIST, sizeof(slot_dist_data[0]));
 					if (!slot_dist_data)
 						return -1;
 					slot_dist_size = get_distribution(*argv, slot_dist_data, MAX_DIST);
-- 
2.45.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ