summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Maste <emaste@FreeBSD.org>2020-03-08 16:53:46 +0000
committerEd Maste <emaste@FreeBSD.org>2020-03-08 16:53:46 +0000
commit3737a1f80b93fc06896ed08c7c79d03d6acd0753 (patch)
treea0e9893d80af26b28d05e67a625c0a498bfd1ecc
parent560b6a1f352529c1e59d9573677b52b68a302807 (diff)
Notes
-rw-r--r--lib/libfetch/fetch.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c
index 8d92bbcb7808e..c4e41a5fa551d 100644
--- a/lib/libfetch/fetch.c
+++ b/lib/libfetch/fetch.c
@@ -327,6 +327,8 @@ fetch_pctdecode(char *dst, const char *src, size_t dlen)
}
if (dlen-- > 0)
*dst++ = c;
+ else
+ return (NULL);
}
return (s);
}
@@ -373,11 +375,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;