]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: AF_UNIX: fix creating abstract socket symlink name
authorCorinna Vinschen <corinna@vinschen.de>
Sat, 10 Mar 2018 20:07:46 +0000 (21:07 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Sat, 10 Mar 2018 20:07:46 +0000 (21:07 +0100)
Add missing NUL termination when creating symlink representing
abstract socket.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/fhandler_socket_unix.cc

index f3f3fba99975988071cfb3225cd18c4834f23493..9ac9b245279d283f64c44e42f37cdbad71639a02 100644 (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);
This page took 0.034657 seconds and 5 git commands to generate.