Thread (41 messages) 41 messages, 6 authors, 2016-06-27
STALE3640d
Revisions (2)
  1. v4 [diff vs current]
  2. v5 current

[PATCH v5 5/5] app/pdump: fix type casting of ring size

From: Reshma Pattan <hidden>
Date: 2016-06-24 16:36:27
Subsystem: the rest · Maintainer: Linus Torvalds

ring_size value is wrongly type casted to uint16_t.
It should be type casted to uint32_t, as maximum
ring size is 28bit long. Wrong type cast
wrapping around the ring size values bigger than 65535.

Fixes: caa7028276b8 ("app/pdump: add tool for packet capturing")

Signed-off-by: Reshma Pattan <redacted>
---
 app/pdump/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/pdump/main.c b/app/pdump/main.c
index fe4d38a..2087c15 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -362,7 +362,7 @@ parse_pdump(const char *optarg)
 						&parse_uint_value, &v);
 		if (ret < 0)
 			goto free_kvlist;
-		pt->ring_size = (uint16_t) v.val;
+		pt->ring_size = (uint32_t) v.val;
 	} else
 		pt->ring_size = RING_SIZE;
 
-- 
2.5.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help