From: Guido Vranken Date: Mon, 26 Jun 2017 18:29:34 +0000 (+0200) Subject: Prepare mroute.c, mroute.h for fuzzing X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=47ef9726122c525cf79e09246416ae7351c1f638;p=thirdparty%2Fopenvpn.git Prepare mroute.c, mroute.h for fuzzing --- diff --git a/src/openvpn/mroute.c b/src/openvpn/mroute.c index 7b46a6a2d..b670d9188 100644 --- a/src/openvpn/mroute.c +++ b/src/openvpn/mroute.c @@ -373,7 +373,9 @@ mroute_addr_mask_host_bits(struct mroute_addr *ma) } else { - ASSERT(0); + /* Disabled for fuzzing + * ASSERT(0); + */ } } @@ -545,7 +547,10 @@ mroute_helper_del_iroute46(struct mroute_helper *mh, int netbits) ASSERT(netbits < MR_HELPER_NET_LEN); ++mh->cache_generation; --mh->net_len_refcount[netbits]; - ASSERT(mh->net_len_refcount[netbits] >= 0); + if ( !(mh->net_len_refcount[netbits] >= 0) ) + { + return; + } if (!mh->net_len_refcount[netbits]) { mroute_helper_regenerate(mh); diff --git a/src/openvpn/mroute.h b/src/openvpn/mroute.h index e57a9506e..5917c7d95 100644 --- a/src/openvpn/mroute.h +++ b/src/openvpn/mroute.h @@ -96,7 +96,6 @@ struct mroute_addr { in_addr_t addr; /* _network order_ IPv4 address */ } v4mappedv6; } -#ifndef HAVE_ANONYMOUS_UNION_SUPPORT /* Wrappers to support compilers that do not grok anonymous unions */ mroute_union #define raw_addr mroute_union.raw_addr @@ -104,7 +103,6 @@ struct mroute_addr { #define v4 mroute_union.v4 #define v6 mroute_union.v6 #define v4mappedv6 mroute_union.v4mappedv6 -#endif ; };