Unverified Commit a98c9fb2 authored by Sefa Eyeoglu's avatar Sefa Eyeoglu Committed by Vladimír Čunát
Browse files

curl: backport other netrc regression fix



Signed-off-by: default avatarSefa Eyeoglu <contact@scrumplex.net>
(cherry picked from commit 846d78b9)
(cherry picked from commit fedcf60a)
parent 0e2bef09
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
From 0cdde0fdfbeb8c35420f6d03fa4b77ed73497694 Mon Sep 17 00:00:00 2001
From: Daniel Stenberg <daniel@haxx.se>
Date: Thu, 7 Nov 2024 17:03:54 +0100
Subject: [PATCH] netrc: support large file, longer lines, longer tokens

Regression from 3b43a05e000aa8f6 (shipped in 8.11.0)

Reported-by: Moritz
Fixes #15513
Closes #15514
---
 lib/netrc.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/netrc.c b/lib/netrc.c
index c23f927cef32d35059360f04be3c7833589f5df5..034c0307a43e3b86c9c004387cedf273588370e1 100644
--- a/lib/netrc.c
+++ b/lib/netrc.c
@@ -58,9 +58,9 @@ enum found_state {
 #define NETRC_FAILED -1
 #define NETRC_SUCCESS 0
 
-#define MAX_NETRC_LINE 4096
-#define MAX_NETRC_FILE (64*1024)
-#define MAX_NETRC_TOKEN 128
+#define MAX_NETRC_LINE 16384
+#define MAX_NETRC_FILE (128*1024)
+#define MAX_NETRC_TOKEN 4096
 
 static CURLcode file2memory(const char *filename, struct dynbuf *filebuf)
 {
+4 −0
Original line number Diff line number Diff line
@@ -65,6 +65,10 @@ stdenv.mkDerivation (finalAttrs: {
    # https://github.com/curl/curl/commit/f5c616930b5cf148b1b2632da4f5963ff48bdf88
    # TODO: Remove this patch when 8.11.1/8.12.0 releases
    ./fix-netrc-regression.patch

    # https://github.com/curl/curl/issues/15513
    # https://github.com/curl/curl/commit/0cdde0fdfbeb8c35420f6d03fa4b77ed73497694
    ./fix-netrc-regression-2.patch
  ];

  # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion