Crash found in the fuzzer is because the ospf pointer looked
up for the default vrf instance returns NULL, which immediately
crashes. Normal OSPF code, to even get here, requires a default
instance of ospf. As such the fuzzing code violated a tenant
of the main ospf code. Let's just fix the ospf fuzzing code
to create a default vrf and then associate the ospf code
with it.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
{
struct prefix p;
struct interface *ifp = if_get_by_name("fuzziface", 0, "default");
+ struct vrf *vrf = vrf_get(VRF_DEFAULT, VRF_DEFAULT_NAME);
ifp->mtu = 68;
str2prefix("11.0.2.0/24", &p);
bool created;
- struct ospf *o = ospf_get(0, "omgwtfbbq", &created);
+ struct ospf *o = ospf_get(0, VRF_DEFAULT_NAME, &created);
o->fd = 69;
struct in_addr in;
/* Not reached. */
return 0;
}
-#endif
\ No newline at end of file
+#endif