Set terminator explicitly

pull/9833/head
David Garcia Quintas 8 years ago
parent bcd5f12e4b
commit f05359f697
  1. 2
      src/core/ext/client_channel/parse_address.c

@ -49,10 +49,10 @@
int parse_unix(grpc_uri *uri, grpc_resolved_address *resolved_addr) {
struct sockaddr_un *un = (struct sockaddr_un *)resolved_addr->addr;
memset(un, 0, sizeof(*un));
un->sun_family = AF_UNIX;
strncpy(un->sun_path, uri->path, sizeof(un->sun_path) - 1 /* null term'd */);
un->sun_path[sizeof(un->sun_path) - 1] = '\0';
resolved_addr->len = strlen(un->sun_path) + sizeof(un->sun_family) + 1;
return 1;

Loading…
Cancel
Save