This is the mail archive of the cygwin-patches mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] handle_to_fn: null terminate


On Fri, Mar 07, 2008 at 05:38:58PM -0800, Brian Dessent wrote:
>
>I noticed in strace some lines like:
>
>fhandler_base::close: closing
>'/Device/NamedPipe/Win32Pipes.000008e0.00000002<several junk bytes>'
>handle 0x740
>
>This was caused by handle_to_fn simply forgetting to add a \0 when
>converting, as in the attached patch.
>
>Brian
>2008-03-07  Brian Dessent  <brian@dessent.net>
>
>	* dtable.cc (handle_to_fn): Null-terminate posix_fn in the case
>	of justslash = true.
>
>Index: dtable.cc
>===================================================================
>RCS file: /cvs/src/src/winsup/cygwin/dtable.cc,v
>retrieving revision 1.182
>diff -u -p -r1.182 dtable.cc
>--- dtable.cc	15 Feb 2008 17:53:10 -0000	1.182
>+++ dtable.cc	8 Mar 2008 01:33:52 -0000
>@@ -952,6 +952,7 @@ handle_to_fn (HANDLE h, char *posix_fn)
> 	  *d = '/';
> 	else
> 	  *d = *s;
>+      *d = 0;
>     }
> 
>   debug_printf ("derived path '%s', posix '%s'", w32, posix_fn);

Huh.  I had the same fix sitting in my sandbox and never checked it in.
Please check this in.

cgf


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]