1
0
mirror of https://github.com/moparisthebest/wget synced 2024-07-03 16:38:41 -04:00

Fix range check in map_html_tags()

This commit is contained in:
Witchakorn Kamolpornwijit 2014-11-01 21:01:56 -04:00 committed by Tim Rühsen
parent cf4991d602
commit 6e259b76b7
2 changed files with 5 additions and 1 deletions

View File

@ -1,3 +1,7 @@
2014-11-12 Witchakorn Kamolpornwijit <witchakk@mit.edu> (tiny change)
* html-parse.c (map_html_tags): Fix range check
2014-11-11 Tim Ruehsen <tim.ruehsen@gmx.de> 2014-11-11 Tim Ruehsen <tim.ruehsen@gmx.de>
* openssl.c (ssl_init): Load CRL file given by --crl-file * openssl.c (ssl_init): Load CRL file given by --crl-file

View File

@ -881,7 +881,7 @@ map_html_tags (const char *text, int size,
if (*p == '!') if (*p == '!')
{ {
if (!(flags & MHT_STRICT_COMMENTS) if (!(flags & MHT_STRICT_COMMENTS)
&& p < end + 3 && p[1] == '-' && p[2] == '-') && p + 3 < end && p[1] == '-' && p[2] == '-')
{ {
/* If strict comments are not enforced and if we know /* If strict comments are not enforced and if we know
we're looking at a comment, simply look for the we're looking at a comment, simply look for the