Skip to content
Snippets Groups Projects
Commit f05359f6 authored by David Garcia Quintas's avatar David Garcia Quintas
Browse files

Set terminator explicitly

parent bcd5f12e
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment