Skip to content

Commit

Permalink
Import the libfetch patch to the bundled libfetch
Browse files Browse the repository at this point in the history
  • Loading branch information
bapt committed Jan 29, 2020
1 parent 82f3ddb commit eec0b5c
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
1 change: 1 addition & 0 deletions ports-mgmt/pkg/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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}/ \
Expand Down
31 changes: 31 additions & 0 deletions ports-mgmt/pkg/files/patch-libfetch
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit eec0b5c

Please sign in to comment.