From 44471ad36d13da6563a2244dcac863ac5e9e829b Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 19 Nov 2010 13:07:56 -0800 Subject: [PATCH] netdev-vport: Fix segfault on bad vport configuration. When a vport parse error occurs, the vport_class's parse_config function doesn't necessarily store a valid pointer into the vport_info's 'config' member, so netdev_vport_create() needs to supply a null pointer here to avoiding passing a wild pointer to free(). --- lib/netdev-vport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/netdev-vport.c b/lib/netdev-vport.c index 7bc4d0338..197e74bb2 100644 --- a/lib/netdev-vport.c +++ b/lib/netdev-vport.c @@ -110,7 +110,7 @@ netdev_vport_parse_config(const struct netdev_class *netdev_class, info.devname = name; info.type = netdev_class->type; error = (c->parse_config)(&info, args); - *configp = info.config; + *configp = error ? NULL : info.config; return error; } else { if (!shash_is_empty(args)) { -- 2.45.2