doc/share/security/patches/SA-20:01/libfetch.patch
2020-01-28 19:12:55 +00:00

29 lines
494 B
Diff

--- lib/libfetch/fetch.c.orig
+++ lib/libfetch/fetch.c
@@ -332,6 +332,8 @@
}
if (dlen-- > 0)
*dst++ = c;
+ else
+ return (NULL);
}
return (s);
}
@@ -381,11 +383,15 @@
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;