aboutsummaryrefslogtreecommitdiff
Avoid usage of PATH_MAX.

Submitted to bug-less@gnu.org.

From ef652341ed8b2c14ac40312ccd4ed329cb69fd0c Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sat, 7 Mar 2020 14:57:19 +0100
Subject: [PATCH] Avoid usage of PATH_MAX.

* filename.c (lrealpath): Have realpath allocate the buffer.  Fixes
compilation on the Hurd and avoids possible buffer overflow on other
systems.
---
 filename.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/filename.c b/filename.c
index e420837..faa71b0 100644
--- a/filename.c
+++ b/filename.c
@@ -795,9 +795,9 @@ lrealpath(path)
 	char *path;
 {
 #if HAVE_REALPATH
-	char rpath[PATH_MAX];
-	if (realpath(path, rpath) != NULL)
-		return (save(rpath));
+	char *rpath = NULL;
+	if ((rpath = realpath(path, rpath)) != NULL)
+		return (rpath);
 #endif
 	return (save(path));
 }
-- 
2.24.0

g0....ng0 2018-04-03services: certbot: Don't try to renew certificates on activation....Clément Lassieur 2018-03-20Correct name and Email for ng0....ng0 2018-02-22services: certbot: Allow to set a deploy hook....Clément Lassieur 2018-02-22services: certbot: Add verbosity....Clément Lassieur 2018-02-22services: certbot: Allow to set RSA key size....Clément Lassieur 2018-02-22services: certbot: Associate one certificate with several domains....Clément Lassieur 2018-02-22services: certbot: Get certbot to run non-interactively....Clément Lassieur 2018-02-22services: certbot: Refactor certbot command....Clément Lassieur 2018-02-22services: certbot: Rename 'host' to 'domain'....Clément Lassieur 2018-02-22services: certbot: Fix indentation....Clément Lassieur 2018-02-22services: certbot: Run certbot twice a day at a random minute....Clément Lassieur 2018-02-22services: certbot: Listen on IPv6....Clément Lassieur 2017-12-18services: nginx: Replace 'http-port' and 'https-port' with 'listen'....Clément Lassieur 2017-12-17services: certbot: Fix certbot renewal job....Christopher Baines 2017-11-28services: certbot: Add default value and description....Ludovic Courtès 2017-11-28services: Add certbot service....Andy Wingo