mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Subject: Re: [PATCH] increase buffer size in getmntent to 4096 bytes
Date: Mon, 17 Oct 2016 16:29:58 -0400	[thread overview]
Message-ID: <20161017202958.GG19318@brightrain.aerifal.cx> (raw)
In-Reply-To: <20161017144817.299986f4@ncopa-desktop.copa.dup.pw>

On Mon, Oct 17, 2016 at 02:48:17PM +0200, Natanael Copa wrote:
> On Mon, 17 Oct 2016 10:24:25 +0000
> Rostislav Skudnov <rostislav@tuxera.com> wrote:
> 
> > getmntent fails if the length of the mount entry exceeds the buffer
> > size. The new buffer size matches that of glibc.
> > ---
> > Even after this patch, getmntent may still fail since the device and mount
> > paths may be up to PATH_MAX in length, and the mount options may
> > (theoretically) have unlimited length. The same would happen in glibc, though.
> 
> This patch solve the same problem, but uses getline to malloc the buffer as needed:
> http://www.openwall.com/lists/musl/2016/09/08/1

Indeed. We can't go making every program use an additional page of
memory just for a rare program that uses getmntent, so dynamic
allocation it had to be.

Rich


      reply	other threads:[~2016-10-17 20:29 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-17 10:24 Rostislav Skudnov
2016-10-17 12:48 ` Natanael Copa
2016-10-17 20:29   ` Rich Felker [this message]

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=20161017202958.GG19318@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=musl@lists.openwall.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.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).