Initializing virname to NULL in cases where it was uninitialized.

pull/51/head
Micah Snyder 7 years ago
parent 2459b65198
commit e551468a03
  1. 4
      clamd/onaccess_fan.c
  2. 2
      clamd/onaccess_scth.c
  3. 4
      clamd/scanner.c
  4. 2
      clamscan/manager.c

@ -72,7 +72,7 @@ static void onas_fan_exit(int sig)
static int onas_fan_scanfile(int fan_fd, const char *fname, struct fanotify_event_metadata *fmd, int scan, int extinfo, struct thrarg *tharg)
{
struct fanotify_response res;
const char *virname;
const char *virname = NULL;
int ret = 0;
res.fd = fmd->fd;
@ -336,7 +336,7 @@ static void cauth_exit(int sig)
static int cauth_scanfile(const char *fname, int extinfo, struct thrarg *tharg)
{
struct cb_context context;
const char *virname;
const char *virname = NULL;
int ret = 0, fd;
context.filename = fname;

@ -57,7 +57,7 @@ static void onas_scth_exit(int sig) {
static int onas_scth_scanfile(const char *fname, int fd, int extinfo, struct scth_thrarg *tharg)
{
int ret = 0;
const char *virname;
const char *virname = NULL;
return onas_scan(fname, fd, &virname, tharg->engine, tharg->options, extinfo);
}

@ -358,7 +358,7 @@ int scanfd(const client_conn_t *conn, unsigned long int *scanned,
unsigned int options, const struct optstruct *opts, int odesc, int stream)
{
int ret, fd = conn->scanfd;
const char *virname;
const char *virname = NULL;
STATBUF statbuf;
struct cb_context context;
char fdstr[32];
@ -425,7 +425,7 @@ int scanstream(int odesc, unsigned long int *scanned, const struct cl_engine *en
unsigned int port = 0, portscan, min_port, max_port;
unsigned long int quota = 0, maxsize = 0;
short bound = 0;
const char *virname;
const char *virname = NULL;
char buff[FILEBUFF];
char peer_addr[32];
struct cb_context context;

@ -294,7 +294,7 @@ static void scanfile(const char *filename, struct cl_engine *engine, const struc
int ret = 0, fd, included;
unsigned i;
const struct optstruct *opt;
const char *virname;
const char *virname = NULL;
STATBUF sb;
struct metachain chain;
struct clamscan_cb_data data;

Loading…
Cancel
Save