From 47ef9726122c525cf79e09246416ae7351c1f638 Mon Sep 17 00:00:00 2001 From: Guido Vranken Date: Mon, 26 Jun 2017 20:29:34 +0200 Subject: [PATCH] Prepare mroute.c, mroute.h for fuzzing --- src/openvpn/mroute.c | 9 +++++++-- src/openvpn/mroute.h | 2 -- 2 files changed, 7 insertions(+), 4 deletions(-) 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 ; }; -- 2.47.2