0.98.2
Shawn Webb 13 years ago
parent c6bfda94fd
commit e522909e19
  1. 5
      clamscan/manager.c
  2. 4
      libclamav/bytecode.c
  3. 4
      libclamav/mpool.c
  4. 2
      libclamav/readdb.c
  5. 4
      sigtool/sigtool.c
  6. 1
      unit_tests/check_jsnorm.c

@ -389,6 +389,11 @@ static void scandirs(const char *dirname, struct cl_engine *engine, const struct
if(strcmp(dent->d_name, ".") && strcmp(dent->d_name, "..")) {
/* build the full name */
fname = malloc(strlen(dirname) + strlen(dent->d_name) + 2);
if (fname == NULL) { /* oops, malloc() failed, print warning and return */
logg("!scandirs: Memory allocation failed for fname\n");
return;
}
if(!strcmp(dirname, PATHSEP))
sprintf(fname, PATHSEP"%s", dent->d_name);
else

@ -93,6 +93,10 @@ static int cli_bytecode_context_reset(struct cli_bc_ctx *ctx);
struct cli_bc_ctx *cli_bytecode_context_alloc(void)
{
struct cli_bc_ctx *ctx = cli_calloc(1, sizeof(*ctx));
if (!ctx) {
cli_errmsg("Out of memory allocating cli_bytecode_context_reset\n");
return NULL;
}
ctx->bytecode_timeout = 60000;
cli_bytecode_context_reset(ctx);
return ctx;

@ -749,6 +749,10 @@ unsigned char *cli_mpool_hex2str(mpool_t *mp, const char *hex) {
}
str = mpool_malloc(mp, (len/2) + 1);
if (str == NULL) { /* oops, we have a memory pool allocation failure */
cli_errmsg("cli_mpool_hex2str(): Can't allocate memory (%lu bytes).\n", (unsigned int)(len/2 + 1));
return NULL;
}
if (cli_hex2str_to(hex, (char*)str, len) == -1) {
mpool_free(mp, str);
return NULL;

@ -153,7 +153,7 @@ int cli_parse_add(struct cli_matcher *root, const char *virname, const char *hex
patt->length = root->ac_mindepth;
/* dummy */
patt->pattern = mpool_calloc(root->mempool, patt->length, sizeof(*patt->pattern));
if (patt->pattern) {
if (!patt->pattern) {
free(patt);
return CL_EMEM;
}

@ -2019,6 +2019,10 @@ static char *decodehexstr(const char *hex, unsigned int *dlen)
wildcard++;
decoded = calloc(len + 1 + wildcard * 32, sizeof(char));
if(!decoded) {
mprintf("!decodehexstr: Can't allocate memory for decoded\n");
return NULL;
}
for(i = 0; i < len; i++) {
if(str16[i] & CLI_MATCH_WILDCARD) {

@ -404,6 +404,7 @@ START_TEST (js_buffer)
char *exp = malloc(len + sizeof(s_exp) + sizeof(e_exp) - 2);
fail_unless(!!tst, "malloc");
fail_unless(!!exp, "malloc");
memset(tst, 'a', len);
strncpy(tst, s, strlen(s));

Loading…
Cancel
Save