phroxy

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.z3bra.org/phroxy.git
Log | Files | Refs | LICENSE

commit 65b08e3fe1928eb217aa59c7f936d13b9a6a5031
parent fe4f5657743a30daa28fe32376c1158b0b0240d3
Author: Willy Goiffon <dev@z3bra.org>
Date:   Mon, 14 Sep 2020 15:54:23 +0200

Return 404 when host cannot be extracted

Diffstat:
Mphroxy.c | 8+++++++-
1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/phroxy.c b/phroxy.c @@ -343,7 +343,8 @@ phroxy(char *url) { int sock; size_t len; - char item, *hole, *path, *host, *port; + char item = 0; + char *hole, *path, *host, *port; char *data = NULL; hole = url + 1; @@ -356,6 +357,11 @@ phroxy(char *url) if (!port) port = "70"; + if (!hole || !item) { + print404(); + return 1; + } + sock = connectto(host, port); if (!sendselector(sock, path)) data = getrawitem(sock, &len);