[PATCH] Avoid near-infinite looping in __gen_tempname

Nickolai Zeldovich nickolai at cs.stanford.edu
Wed May 2 17:15:49 UTC 2007


Oops, I mis-merged with 0.9.29-rc1..  The outer variable used to be
called "count" in 0.9.28.  Attached is the fixed version.

Nickolai.

On 5/2/07, Mike Frysinger <vapier at gentoo.org> wrote:
> On Monday 30 April 2007, Nickolai Zeldovich wrote:
> > On 4/30/07, Mike Frysinger <vapier at gentoo.org> wrote:
> > > On Sunday 22 April 2007, Nickolai Zeldovich wrote:
> > > > The code to create a unique file (mktemp) has a logic error in uClibc.
> > > >  When __gen_tempname picks a file name that already exists, the code
> > > > attempts to retry.  However, the code to pick a new file name is
> > > > outside of this retry loop, causing a retry with the same exact
> > > > filename, which is very likely to fail again.  This patch fixes this
> > > > problem by moving the random filename generation code inside the retry
> > > > loop:
> > >
> > > so attach your patch since the URL here is unavailable
> >
> > Patch attached.
>
> erm that's no good ... you've got a nested for loop and they both use the
> variable "i" ...
> -mike
>
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: uclibc-tempname2.patch
Type: application/octet-stream
Size: 1031 bytes
Desc: not available
Url : http://lists.busybox.net/pipermail/uclibc/attachments/20070502/a5bdc864/attachment-0002.obj 


More information about the uClibc mailing list