summaryrefslogtreecommitdiffstats
path: root/lib/libfetch/fetch.c
diff options
context:
space:
mode:
authordes <des@FreeBSD.org>2000-12-13 11:21:09 +0000
committerdes <des@FreeBSD.org>2000-12-13 11:21:09 +0000
commitae0af0d011fe1231b7c46f671bec0ebf92af084d (patch)
tree3dc4eafbb69b91aa5f49b4994f20d041090fb9ff /lib/libfetch/fetch.c
parent635b424e75b70075159860177e730f0baae40646 (diff)
downloadFreeBSD-src-ae0af0d011fe1231b7c46f671bec0ebf92af084d.zip
FreeBSD-src-ae0af0d011fe1231b7c46f671bec0ebf92af084d.tar.gz
Avoid a segfault (due to an unitialized pointer) when parsing URLs that have
no scheme or host part.
Diffstat (limited to 'lib/libfetch/fetch.c')
-rw-r--r--lib/libfetch/fetch.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libfetch/fetch.c b/lib/libfetch/fetch.c
index b26cad0..bc803d5 100644
--- a/lib/libfetch/fetch.c
+++ b/lib/libfetch/fetch.c
@@ -314,6 +314,8 @@ fetchParseURL(char *URL)
*/
if (URL[1] == '/')
URL = (p += 2);
+ } else {
+ p = URL;
}
if (!*URL || *URL == '/')
goto nohost;
OpenPOWER on IntegriCloud