sockaddr_un needs the null terminator included in the address length

pull/701/head
Craig Tiller 10 years ago
parent 9ec95fafdc
commit 1f8d92d3ec
  1. 2
      src/core/iomgr/resolve_address.c

@ -134,7 +134,7 @@ grpc_resolved_addresses *grpc_blocking_resolve_address(
un = (struct sockaddr_un *)addrs->addrs->addr;
un->sun_family = AF_UNIX;
strcpy(un->sun_path, name + 5);
addrs->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family);
addrs->addrs->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1;
return addrs;
}

Loading…
Cancel
Save