[ovs-dev] [PATCH] dpif-netdev: Fix use-after-free in dpif_netdev_recv.

Ben Pfaff blp at nicira.com
Sat Jun 9 15:55:29 UTC 2012


Found by valgrind.

Signed-off-by: Ben Pfaff <blp at nicira.com>
---
 lib/dpif-netdev.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/dpif-netdev.c b/lib/dpif-netdev.c
index fb0a863..cade79e 100644
--- a/lib/dpif-netdev.c
+++ b/lib/dpif-netdev.c
@@ -956,7 +956,7 @@ dpif_netdev_recv(struct dpif *dpif, struct dpif_upcall *upcall,
         free(u);
 
         ofpbuf_uninit(buf);
-        *buf = *u->packet;
+        *buf = *upcall->packet;
 
         return 0;
     } else {
-- 
1.7.2.5




More information about the dev mailing list