[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] mkdtemp: proper error detection on mktemp
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2020-12-08 17:46:57
Message-ID: CAK1hOcOXcsfN=Nd7o7anG=OUmaFYocC_egX8Pe84GAGqYTkn+w () mail ! gmail ! com
[Download RAW message or body]

applied, thanks

On Fri, Dec 4, 2020 at 8:53 AM Alexander Dahl <ada@thorsis.com> wrote:
>
> Hei hei,
>
> Am Donnerstag, 3. Dezember 2020, 23:42:24 CET schrieb Xabier Oneca -- xOneca:
> > On error, mktemp returns an empty string, not NULL.
> >
> > Signed-off-by: Xabier Oneca <xoneca@gmail.com>
> > ---
> >  libbb/platform.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/libbb/platform.c b/libbb/platform.c
> > index 03bbb798..187670a8 100644
> > --- a/libbb/platform.c
> > +++ b/libbb/platform.c
> > @@ -107,7 +107,7 @@ void* FAST_FUNC memrchr(const void *s, int c, size_t n)
> >  /* This is now actually part of POSIX.1, but was only added in 2008 */
> >  char* FAST_FUNC mkdtemp(char *template)
> >  {
> > -    if (mktemp(template) == NULL || mkdir(template, 0700) != 0)
> > +    if (mktemp(template)[0] == '\0' || mkdir(template, 0700) != 0)
> >          return NULL;
> >      return template;
> >  }
>
> Acked-by: Alexander Dahl <ada@thorsis.com>
>
> Greets
> Alex
>
>
>
> _______________________________________________
> busybox mailing list
> busybox@busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic