Navigation Menu

Skip to content

Commit

Permalink
Added an upper limit on the number of redirects
Browse files Browse the repository at this point in the history
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
  • Loading branch information
Nikos Mavrogiannopoulos authored and David Woodhouse committed Feb 24, 2015
1 parent c26d459 commit f3e0f37
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions http.c
Expand Up @@ -791,11 +791,17 @@ int do_https_request(struct openconnect_info *vpninfo, const char *method,
int rq_retry;
int rlen, pad;
int auth = 0;
int max_redirects = 10;

if (request_body_type && buf_error(request_body))
return buf_error(request_body);

redirected:
if (max_redirects-- <= 0) {
result = -EIO;
goto out;
}

vpninfo->redirect_type = REDIR_TYPE_NONE;

if (*form_buf) {
Expand Down

0 comments on commit f3e0f37

Please sign in to comment.