DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH] null: Fix dereference before null check in eth_null_copy_tx()
@ 2015-03-16  3:43 Tetsuya Mukawa
  2015-03-17 22:00 ` Thomas Monjalon
  0 siblings, 1 reply; 2+ messages in thread
From: Tetsuya Mukawa @ 2015-03-16  3:43 UTC (permalink / raw)
  To: dev

This patch fixes potential null pointer access of eth_null_copy_tx().

Reported-by: Mcnamara, John <john.mcnamara@intel.com>
Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>
---
 lib/librte_pmd_null/rte_eth_null.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lib/librte_pmd_null/rte_eth_null.c b/lib/librte_pmd_null/rte_eth_null.c
index 86307eb..8a20c9d 100644
--- a/lib/librte_pmd_null/rte_eth_null.c
+++ b/lib/librte_pmd_null/rte_eth_null.c
@@ -160,11 +160,12 @@ eth_null_copy_tx(void *q, struct rte_mbuf **bufs, uint16_t nb_bufs)
 {
 	int i;
 	struct null_queue *h = q;
-	unsigned packet_size = h->internals->packet_size;
+	unsigned packet_size;
 
 	if ((q == NULL) || (bufs == NULL))
 		return 0;
 
+	packet_size = h->internals->packet_size;
 	for (i = 0; i < nb_bufs; i++) {
 		rte_memcpy(h->dummy_packet, rte_pktmbuf_mtod(bufs[i], void *),
 					packet_size);
-- 
1.9.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [dpdk-dev] [PATCH] null: Fix dereference before null check in eth_null_copy_tx()
  2015-03-16  3:43 [dpdk-dev] [PATCH] null: Fix dereference before null check in eth_null_copy_tx() Tetsuya Mukawa
@ 2015-03-17 22:00 ` Thomas Monjalon
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Monjalon @ 2015-03-17 22:00 UTC (permalink / raw)
  To: Tetsuya Mukawa; +Cc: dev

> This patch fixes potential null pointer access of eth_null_copy_tx().
> 
> Reported-by: Mcnamara, John <john.mcnamara@intel.com>
> Signed-off-by: Tetsuya Mukawa <mukawa@igel.co.jp>

Applied, thanks

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-17 22:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-16  3:43 [dpdk-dev] [PATCH] null: Fix dereference before null check in eth_null_copy_tx() Tetsuya Mukawa
2015-03-17 22:00 ` Thomas Monjalon

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).