This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc 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] support: Implement <support/descriptors.h> to track file descriptors


On Thu, Nov 29, 2018 at 10:44:10PM -0500, Carlos O'Donell wrote:
> On 11/27/18 12:25 PM, Florian Weimer wrote:
[...]
> > +      char path[100];
> 
> Why not PATH_MAX?
> 
> We should not stat a truncated fd path since it might match another fd?
> 
> 	 assert (strlen(e->d_name) < PATH_MAX);
> 
> > +      snprintf (path, sizeof (path), "/proc/self/fd/%ld", fd);

Or just use xasprintf instead.


-- 
ldv


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