From: "Richard W.M. Jones" Subject: Re: [PATCH v3] ws2_32: Very minimal support for AF_UNIX. Message-Id: <20200908172613.GB28234@redhat.com> Date: Tue, 8 Sep 2020 18:26:13 +0100 In-Reply-To: <20200908171240.4182912-2-rjones@redhat.com> References: <20200908171240.4182912-1-rjones@redhat.com> <20200908171240.4182912-2-rjones@redhat.com> Oh dear me, the perils of making a last second change before posting the patch ... On Tue, Sep 08, 2020 at 06:12:40PM +0100, Richard W.M. Jones wrote: > + /* Note that in Win32 sun_path is "a null-terminated UTF-8 > + * file system path". We have to translate to a Unix path. > + */ > + num = MultiByteToWideChar(CP_UTF8, 0, wun->sun_path, -1, NULL, 0); > + win_path = HeapAlloc(GetProcessHeap(), 0, num); This line didn't allocate enough space, it should be: win_path = HeapAlloc(GetProcessHeap(), 0, num * sizeof(WCHAR)); Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming and virtualization blog: http://rwmj.wordpress.com virt-p2v converts physical machines to virtual machines. Boot with a live CD or over the network (PXE) and turn machines into KVM guests. http://libguestfs.org/virt-v2v