diff options
author | 2017-04-13 06:45:22 -0700 | |
---|---|---|
committer | 2017-04-13 06:45:22 -0700 | |
commit | 4d0ee2a56b71b3eae4865c6440362daebba0b5f7 (patch) | |
tree | c28dbf8e1761fb75f765060d2b120156e1bac994 /src/core/lib/iomgr/sockaddr_utils.c | |
parent | b78e80c0961bf87cae82a1cf7d6e200d6787c73a (diff) | |
parent | 7fea75125846a0326dfa907c5a310f62d5f8e567 (diff) |
Merge pull request #10605 from ctiller/ubsan
Ubsan fixes
Diffstat (limited to 'src/core/lib/iomgr/sockaddr_utils.c')
-rw-r--r-- | src/core/lib/iomgr/sockaddr_utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/sockaddr_utils.c b/src/core/lib/iomgr/sockaddr_utils.c index 9d2732666b..a6a4cac3e2 100644 --- a/src/core/lib/iomgr/sockaddr_utils.c +++ b/src/core/lib/iomgr/sockaddr_utils.c @@ -55,7 +55,9 @@ int grpc_sockaddr_is_v4mapped(const grpc_resolved_address *resolved_addr, GPR_ASSERT(resolved_addr != resolved_addr4_out); const struct sockaddr *addr = (const struct sockaddr *)resolved_addr->addr; struct sockaddr_in *addr4_out = - (struct sockaddr_in *)resolved_addr4_out->addr; + resolved_addr4_out == NULL + ? NULL + : (struct sockaddr_in *)resolved_addr4_out->addr; if (addr->sa_family == AF_INET6) { const struct sockaddr_in6 *addr6 = (const struct sockaddr_in6 *)addr; if (memcmp(addr6->sin6_addr.s6_addr, kV4MappedPrefix, |