Cygwin: AF_UNIX: fix creating abstract socket symlink name

Add missing NUL termination when creating symlink representing
abstract socket.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2018-03-10 21:07:46 +01:00
parent 8b6804b8a8
commit 1bb3d65182
1 changed files with 2 additions and 1 deletions

View File

@ -223,7 +223,8 @@ fhandler_socket_unix::create_abstract_link (const sun_name_t *sun,
/* NUL bytes have no special meaning in an abstract socket name, so
we assume iso-8859-1 for simplicity and transpose the string.
transform_chars_af_unix is doing just that. */
transform_chars_af_unix (p, sun->un.sun_path, sun->un_len);
p = transform_chars_af_unix (p, sun->un.sun_path, sun->un_len);
*p = L'\0';
RtlInitUnicodeString (&uname, name);
InitializeObjectAttributes (&attr, &uname, OBJ_CASE_INSENSITIVE,
get_shared_parent_dir (), NULL);