Merge pull request #10731 from yuwata/fix-oss-fuzz-11344

Fixes oss-fuzz#11344
This commit is contained in:
Lennart Poettering 2018-11-12 10:23:23 +01:00 committed by GitHub
commit bdc0bcf014
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 4 deletions

View file

@ -65,7 +65,9 @@ static inline size_t FAMILY_ADDRESS_SIZE(int family) {
return family == AF_INET6 ? 16 : 4;
}
#define IN_ADDR_NULL ((union in_addr_union) {})
/* Workaround for clang, explicitly specify the maximum-size element here.
* See also oss-fuzz#11344. */
#define IN_ADDR_NULL ((union in_addr_union) { .in6 = {} })
void in_addr_data_hash_func(const void *p, struct siphash *state);
int in_addr_data_compare_func(const void *a, const void *b);

View file

@ -364,10 +364,10 @@ void route_update(Route *route,
assert(route);
assert(src || src_prefixlen == 0);
route->src = src ? *src : (union in_addr_union) {};
route->src = src ? *src : IN_ADDR_NULL;
route->src_prefixlen = src_prefixlen;
route->gw = gw ? *gw : (union in_addr_union) {};
route->prefsrc = prefsrc ? *prefsrc : (union in_addr_union) {};
route->gw = gw ? *gw : IN_ADDR_NULL;
route->prefsrc = prefsrc ? *prefsrc : IN_ADDR_NULL;
route->scope = scope;
route->protocol = protocol;
route->type = type;

View file

@ -0,0 +1,6 @@
[NetDev]
Name=v
Kind=vti
[Tunnel]
Local=::
Local=any