From f4ede0e8e385b7a01d1f11a5e48f3d21bdfd1573 Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Wed, 29 Jan 2020 13:10:14 +0000 Subject: [PATCH] MFH: r524543 Import the libfetch patch to the bundled libfetch Approved by: portmgr (implicit) --- ports-mgmt/pkg/Makefile | 1 + ports-mgmt/pkg/files/patch-libfetch | 31 +++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 ports-mgmt/pkg/files/patch-libfetch diff --git a/ports-mgmt/pkg/Makefile b/ports-mgmt/pkg/Makefile index 2e0ea426cf6d..802621e0ab5a 100644 --- a/ports-mgmt/pkg/Makefile +++ b/ports-mgmt/pkg/Makefile @@ -3,6 +3,7 @@ PORTNAME= pkg DISTVERSION= 1.12.0 _PKG_VERSION= ${DISTVERSION} +PORTREVISION= 1 CATEGORIES= ports-mgmt #MASTER_SITES= \ # http://files.etoilebsd.net/${PORTNAME}/ \ diff --git a/ports-mgmt/pkg/files/patch-libfetch b/ports-mgmt/pkg/files/patch-libfetch new file mode 100644 index 000000000000..162a61b1a469 --- /dev/null +++ b/ports-mgmt/pkg/files/patch-libfetch @@ -0,0 +1,31 @@ +diff --git a/external/libfetch/fetch.c b/external/libfetch/fetch.c +index 47c03a79..df5d5547 100644 +--- external/libfetch/fetch.c ++++ external/libfetch/fetch.c +@@ -332,6 +332,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dlen) + } + if (dlen-- > 0) + *dst++ = c; ++ else ++ return (NULL); + } + return (s); + } +@@ -381,11 +383,15 @@ fetchParseURL(const char *URL) + if (p && *p == '@') { + /* username */ + q = fetch_pctdecode(u->user, URL, URL_USERLEN); ++ if (q == NULL) ++ goto ouch; + + /* password */ +- if (*q == ':') ++ if (*q == ':') { + q = fetch_pctdecode(u->pwd, q + 1, URL_PWDLEN); +- ++ if (q == NULL) ++ goto ouch; ++ } + p++; + } else { + p = URL;