fixes for bb #177:

if all we have is a script in a html file still normalize it
keep global scope, we need it to parse variable names in the correct scope

git-svn: trunk@4058
0.95
Török Edvin 17 years ago
parent 6ba8b9503c
commit fb6208fd12
  1. 3
      libclamav/htmlnorm.c
  2. 1
      libclamav/jsparse/js-norm.c
  3. 6
      unit_tests/check_jsnorm.c

@ -1646,6 +1646,9 @@ abort:
html_tag_contents_done(hrefs,in_ahref);
if(js_state) {
/* output script so far */
cli_js_parse_done(js_state);
cli_js_output(js_state, dirname);
cli_js_destroy(js_state);
js_state = NULL;
}

@ -855,7 +855,6 @@ void cli_js_parse_done(struct parser_state* state)
yylex_destroy(state->scanner);
state->scanner = NULL;
state->global = NULL; /* make this state invalid for parsing */
}

@ -350,13 +350,13 @@ static const char jstest_buf7[] =
"var z=\"tst" B64 "tst\";";
static const char jstest_expected7[] =
"var z=\"tst" B64 "tst\";";
"var n000=\"tst" B64 "tst\";";
static const char jstest_buf8[] =
"var z=\'tst" B64 "tst\';";
static const char jstest_expected8[] =
"var z=\"tst" B64 "tst\";";
"var n000=\"tst" B64 "tst\";";
static const char jstest_buf9[] =
"eval(unescape('%61%6c%65%72%74%28%27%74%65%73%74%27%29%3b'));";
@ -374,7 +374,7 @@ static const char jstest_buf11[] =
"var x=123456789 ;";
static const char jstest_expected11[] =
"var x=123456789;";
"var n000=123456789;";
static struct {
const char *in;

Loading…
Cancel
Save