Read entire .cbc file. Fix loading of bytecode.cvd.

cvd.c checks that we read the entire file, which we don't for
skipped bytecodes.
And we don't read the trailing source code from cbcs.
This all worked for small cbcs since reading the header was enough to
get the entire cbc into the dbio buffer.
0.96
Török Edvin 15 years ago
parent 6e33139f95
commit 1453c0a3eb
  1. 4
      ChangeLog
  2. 5
      libclamav/readdb.c

@ -1,3 +1,7 @@
Tue May 11 15:31:40 EEST 2010 (edwin)
-------------------------------------
* libclamav/readdb.c: read the entire .cbc files, fix loading of bytecode.cvd
Tue May 11 11:36:21 EEST 2010 (edwin)
-------------------------------------
* libclamav/pdf.c: New PDF parser with better javascript support (bb #1596).

@ -1378,6 +1378,7 @@ static int cli_loadldb(FILE *fs, struct cl_engine *engine, unsigned int *signo,
static int cli_loadcbc(FILE *fs, struct cl_engine *engine, unsigned int *signo, unsigned int options, struct cli_dbio *dbio, const char *dbname)
{
char buf[4096];
int rc;
struct cli_all_bc *bcs = &engine->bcs;
struct cli_bc *bc;
@ -1419,6 +1420,10 @@ static int cli_loadcbc(FILE *fs, struct cl_engine *engine, unsigned int *signo,
}
rc = cli_bytecode_load(bc, fs, dbio, security_trust);
/* read remainder of DB, needed because cvd.c checks that we read the entire
* file */
while (cli_dbgets(buf, sizeof(buf), fs, dbio)) {}
if (rc != CL_SUCCESS) {
cli_errmsg("Unable to load %s bytecode: %s\n", dbname, cl_strerror(rc));
return rc;

Loading…
Cancel
Save