From: Corinna Vinschen Date: Sat, 10 Mar 2018 20:07:46 +0000 (+0100) Subject: Cygwin: AF_UNIX: fix creating abstract socket symlink name X-Git-Tag: newlib-snapshot-20180720~121 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=1bb3d6518222fad8e8a40d9af431459b47d03554;p=newlib-cygwin.git Cygwin: AF_UNIX: fix creating abstract socket symlink name Add missing NUL termination when creating symlink representing abstract socket. Signed-off-by: Corinna Vinschen --- diff --git a/winsup/cygwin/fhandler_socket_unix.cc b/winsup/cygwin/fhandler_socket_unix.cc index f3f3fba99..9ac9b2452 100644 --- a/winsup/cygwin/fhandler_socket_unix.cc +++ b/winsup/cygwin/fhandler_socket_unix.cc @@ -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);