git-svn-id: file:///var/lib/svn/clamav-devel/trunk/clamav-devel@2350 77e5149b-7576-45b1-b177-96237e5ba77b
Nigel Horne authored on 2006/10/08 22:56:51... | ... |
@@ -19,7 +19,7 @@ |
19 | 19 |
* Save the JavaScript embedded in an HTML file, then run the script, saving |
20 | 20 |
* the output in a file that is to be scanned, then remove the script file |
21 | 21 |
*/ |
22 |
-static char const rcsid[] = "$Id: js.c,v 1.4 2006/10/08 13:45:10 njh Exp $"; |
|
22 |
+static char const rcsid[] = "$Id: js.c,v 1.5 2006/10/08 13:56:51 njh Exp $"; |
|
23 | 23 |
|
24 | 24 |
#if HAVE_CONFIG_H |
25 | 25 |
#include "clamav-config.h" |
... | ... |
@@ -29,14 +29,16 @@ static char const rcsid[] = "$Id: js.c,v 1.4 2006/10/08 13:45:10 njh Exp $"; |
29 | 29 |
|
30 | 30 |
#if HAVE_MMAP |
31 | 31 |
|
32 |
-#include "clamav.h" |
|
33 |
-#include "others.h" |
|
34 | 32 |
#include <memory.h> |
35 | 33 |
#include <string.h> |
36 | 34 |
#include <limits.h> |
37 | 35 |
#include <errno.h> |
38 | 36 |
#include <ctype.h> |
39 | 37 |
|
38 |
+#include "clamav.h" |
|
39 |
+#include "others.h" |
|
40 |
+#include "js.h" |
|
41 |
+ |
|
40 | 42 |
#if HAVE_SYS_MMAN_H |
41 | 43 |
#include <sys/mman.h> |
42 | 44 |
#endif |
... | ... |
@@ -203,7 +205,7 @@ cli_scanjs(const char *dir, int desc) |
203 | 203 |
else if(fout == NULL) |
204 | 204 |
cli_errmsg("cli_scanjs: fout == NULL\n"); |
205 | 205 |
else { |
206 |
- /*JSInterpPtr interp = create_interp();*/ |
|
206 |
+ JSInterpPtr interp; |
|
207 | 207 |
|
208 | 208 |
fputs("\n}\nmain();\n", fout); |
209 | 209 |
fclose(fout); |
... | ... |
@@ -212,6 +214,8 @@ cli_scanjs(const char *dir, int desc) |
212 | 212 |
* Run NGS on the file |
213 | 213 |
*/ |
214 | 214 |
/* |
215 |
+ interp = create_interp(); |
|
216 |
+ |
|
215 | 217 |
if(!js_eval_file(interp, script_filename)) { |
216 | 218 |
cli_warnmsg("JS failed: %s\n", js_error_message(interp)); |
217 | 219 |
rc = CL_EIO; |