bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Malloc patches, round 1


From: Mark Kettenis
Subject: Re: Malloc patches, round 1
Date: Tue, 31 Jul 2001 12:35:19 +0200

   From: Igor Khavkine <i_khavki@alcor.concordia.ca>
   Date: Mon, 30 Jul 2001 20:25:23 -0400

   diff -ru hurd.orig/exec/exec.c hurd/exec/exec.c
   --- hurd.orig/exec/exec.c    Wed Jul 25 01:49:59 2001
   +++ hurd/exec/exec.c Mon Jul 30 10:36:21 2001
   @@ -2027,6 +2027,8 @@
           {
             int tried = 0;
             list = strdupa (list);
   +      if (! list)
   +        return ENOMEM;
             while ((p = strsep (&list, ":")))
               {
                 /* Open the named file using the appropriate directory ports 
for

I don't think this check is usefull.  strdupa() is allocating the
needed space on the stack (just like alloca()), and will never return
NULL.  If there's not enough space, you'll get a fatal signal instead.

I'll check in the rest, if nobody beats me.

Mark





reply via email to

[Prev in Thread] Current Thread [Next in Thread]