Skip to content

Commit

Permalink
Avoid heap-buffer-overflow in dlt_client_connect (#627)
Browse files Browse the repository at this point in the history
  • Loading branch information
johnmcfarlane authored May 2, 2024
1 parent 723e90e commit d92bb37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/lib/dlt_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ DltReturnValue dlt_client_connect(DltClient *client, int verbose)

memset(&addr, 0, sizeof(addr));
addr.sun_family = AF_UNIX;
memcpy(addr.sun_path, client->socketPath, sizeof(addr.sun_path) - 1);
strncpy(addr.sun_path, client->socketPath, sizeof(addr.sun_path) - 1);

if (connect(client->sock,
(struct sockaddr *) &addr,
Expand Down

0 comments on commit d92bb37

Please sign in to comment.