diff options
author | Thomas E. Dickey <dickey@invisible-island.net> | 2019-08-24 00:37:02 +0000 |
---|---|---|
committer | Thomas E. Dickey <dickey@invisible-island.net> | 2019-08-24 00:37:02 +0000 |
commit | 8aea9066248d82b48dd83b99ad62015feb46ccb2 (patch) | |
tree | 7e7ec03951cc36909ea84f42f02305593e9d9ec9 /src | |
parent | a803e26dcdc6652b12d05f29bbd1b23c4b4239ed (diff) | |
download | lynx-snapshots-8aea9066248d82b48dd83b99ad62015feb46ccb2.tar.gz |
snapshot of project "lynx", label v2-9-0dev_2c
Diffstat (limited to 'src')
-rw-r--r-- | src/HTML.c | 6 | ||||
-rw-r--r-- | src/HTML.h | 3 | ||||
-rw-r--r-- | src/LYReadCFG.c | 11 | ||||
-rw-r--r-- | src/LYrcFile.h | 3 |
4 files changed, 14 insertions, 9 deletions
diff --git a/src/HTML.c b/src/HTML.c index c7183f79..7d954318 100644 --- a/src/HTML.c +++ b/src/HTML.c @@ -1,5 +1,5 @@ /* - * $LynxId: HTML.c,v 1.192 2018/04/01 23:26:24 tom Exp $ + * $LynxId: HTML.c,v 1.193 2019/08/23 23:20:31 tom Exp $ * * Structured stream to Rich hypertext converter * ============================================ @@ -1081,9 +1081,6 @@ static int HTML_start_element(HTStructured * me, int element_number, if (!(url_type = LYLegitimizeHREF(me, &base, TRUE, TRUE))) { CTRACE((tfp, "HTML: BASE '%s' is not an absolute URL.\n", NonNull(base))); - if (me->inBadBASE == FALSE) - HTAlert(BASE_NOT_ABSOLUTE); - me->inBadBASE = TRUE; } if (url_type == LYNXIMGMAP_URL_TYPE) { @@ -7600,7 +7597,6 @@ HTStructured *HTML_new(HTParentAnchor *anchor, me->inA = FALSE; me->inAPPLET = FALSE; me->inAPPLETwithP = FALSE; - me->inBadBASE = FALSE; me->inBadHREF = FALSE; me->inBadHTML = FALSE; me->inBASE = FALSE; diff --git a/src/HTML.h b/src/HTML.h index be2e98f0..9f5d1d5d 100644 --- a/src/HTML.h +++ b/src/HTML.h @@ -1,5 +1,5 @@ /* - * $LynxId: HTML.h,v 1.33 2011/05/19 09:57:53 tom Exp $ + * $LynxId: HTML.h,v 1.34 2019/08/23 23:18:06 tom Exp $ * * HTML to rich text converter for libwww * @@ -148,7 +148,6 @@ extern "C" { BOOL inA; BOOL inAPPLET; BOOL inAPPLETwithP; - BOOL inBadBASE; BOOL inBadHREF; BOOL inBadHTML; BOOL inBASE; diff --git a/src/LYReadCFG.c b/src/LYReadCFG.c index 0c2cd417..5d3d866c 100644 --- a/src/LYReadCFG.c +++ b/src/LYReadCFG.c @@ -1,5 +1,5 @@ /* - * $LynxId: LYReadCFG.c,v 1.194 2019/01/25 13:43:17 tom Exp $ + * $LynxId: LYReadCFG.c,v 1.195 2019/08/24 00:25:43 tom Exp $ */ #ifndef NO_RULES #include <HTRules.h> @@ -1674,6 +1674,7 @@ static Config_Type Config_Table [] = PARSE_ADD(RC_PRINTER, printers), PARSE_SET(RC_QUIT_DEFAULT_YES, LYQuitDefaultYes), PARSE_INT(RC_READ_TIMEOUT, reading_timeout), + PARSE_INT(RC_REDIRECTION_LIMIT, redirection_limit), PARSE_FUN(RC_REFERER_WITH_QUERY, referer_with_query_fun), #ifdef USE_CMD_LOGGING PARSE_TIM(RC_REPLAYSECS, ReplaySecs), @@ -2342,6 +2343,14 @@ static void do_read_cfg(const char *cfg_filename, * And for query/strict/loose invalid cookie checking. - BJP */ LYConfigCookies(); + + /* + * Do not allow infinite redirection loops. + */ + if (redirection_limit < 5) + redirection_limit = 5; + if (redirection_limit > 25) + redirection_limit = 25; } /* this is a public interface to do_read_cfg */ diff --git a/src/LYrcFile.h b/src/LYrcFile.h index bcba7f5b..0397b7de 100644 --- a/src/LYrcFile.h +++ b/src/LYrcFile.h @@ -1,5 +1,5 @@ /* - * $LynxId: LYrcFile.h,v 1.53 2019/01/25 13:40:18 tom Exp $ + * $LynxId: LYrcFile.h,v 1.54 2019/08/24 00:08:45 tom Exp $ */ #ifndef LYRCFILE_H #define LYRCFILE_H @@ -203,6 +203,7 @@ #define RC_QUIT_DEFAULT_YES "quit_default_yes" #define RC_RAW_MODE "raw_mode" #define RC_READ_TIMEOUT "read_timeout" +#define RC_REDIRECTION_LIMIT "redirection_limit" #define RC_REFERER_WITH_QUERY "referer_with_query" #define RC_REPLAYSECS "replaysecs" #define RC_REUSE_TEMPFILES "reuse_tempfiles" |