From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/10637 Path: news.gmane.org!.POSTED!not-for-mail From: Rostislav Skudnov Newsgroups: gmane.linux.lib.musl.general Subject: [PATCH] increase buffer size in getmntent to 4096 bytes Date: Mon, 17 Oct 2016 10:24:25 +0000 Message-ID: <1476699865-5593-1-git-send-email-rostislav@tuxera.com> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1476707680 7297 195.159.176.226 (17 Oct 2016 12:34:40 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 17 Oct 2016 12:34:40 +0000 (UTC) To: Original-X-From: musl-return-10650-gllmg-musl=m.gmane.org@lists.openwall.com Mon Oct 17 14:34:36 2016 Return-path: Envelope-to: gllmg-musl@m.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by blaine.gmane.org with smtp (Exim 4.84_2) (envelope-from ) id 1bw77c-0000cT-G5 for gllmg-musl@m.gmane.org; Mon, 17 Oct 2016 14:34:28 +0200 Original-Received: (qmail 13879 invoked by uid 550); 17 Oct 2016 12:34:28 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Original-Received: (qmail 28473 invoked from network); 17 Oct 2016 10:24:46 -0000 X-Mailer: git-send-email 2.1.4 X-ClientProxiedBy: tuxera-exch.ad.tuxera.com (10.20.48.11) To tuxera-exch.ad.tuxera.com (10.20.48.11) Xref: news.gmane.org gmane.linux.lib.musl.general:10637 Archived-At: 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. src/misc/mntent.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/misc/mntent.c b/src/misc/mntent.c index a16d652..5adb583 100644 --- a/src/misc/mntent.c +++ b/src/misc/mntent.c @@ -49,7 +49,7 @@ struct mntent *getmntent_r(FILE *f, struct mntent *mnt, char *linebuf, int bufle struct mntent *getmntent(FILE *f) { - static char linebuf[256]; + static char linebuf[4096]; static struct mntent mnt; return getmntent_r(f, &mnt, linebuf, sizeof linebuf); } -- 2.1.4