public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Xiaoming Ni <nixiaoming@huawei.com>, libc-alpha@sourceware.org
Subject: Re: ping//Re: [PATCH v2] io:nftw/ftw:fix stack overflow when large nopenfd [BZ #26353]
Date: Fri, 21 Aug 2020 19:51:21 -0700	[thread overview]
Message-ID: <9960d71b-28f0-bf9c-a854-df416363fabf@cs.ucla.edu> (raw)
In-Reply-To: <8fa27d3a-f65c-ee0c-e665-7c4f4ace18e2@huawei.com>

On 8/21/20 7:23 PM, Xiaoming Ni wrote:
> -  data.dirstreams = (struct dir_data **) alloca (data.maxdir
> +  data.dirstreams = (struct dir_data **) malloc (data.maxdir
>                             * sizeof (struct dir_data *));

Surely this should call alloca unless data.maxdir is too large, as malloc puts 
pressure on the heap. That's what's done elsewhere in glibc, anyway.

  reply	other threads:[~2020-08-22  2:51 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-15  7:08 Xiaoming Ni
2020-08-22  2:23 ` ping//Re: " Xiaoming Ni
2020-08-22  2:51   ` Paul Eggert [this message]
2020-08-22  3:27     ` Xiaoming Ni
2020-08-22 18:09       ` Paul Eggert
2020-08-24  8:31         ` Xiaoming Ni
2020-08-24 14:32           ` Adhemerval Zanella

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9960d71b-28f0-bf9c-a854-df416363fabf@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=libc-alpha@sourceware.org \
    --cc=nixiaoming@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).