Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Nessus: commits

NessusClient/nessus cli.c,1.2,1.3

 

 

Nessus commits RSS feed   Index | Next | Previous | View Threaded


renaud at nessus

Jan 5, 2006, 9:17 AM

Post #1 of 1 (251 views)
Permalink
NessusClient/nessus cli.c,1.2,1.3

Update of /usr/local/cvs/NessusClient/nessus
In directory raccoon.nessus.org:/tmp/cvs-serv85412

Modified Files:
cli.c
Log Message:
fixed

Index: cli.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/cli.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- cli.c 11 Sep 2005 11:17:12 -0000 1.2
+++ cli.c 5 Jan 2006 17:17:47 -0000 1.3
@@ -473,7 +473,11 @@
char *in;
{
char * ret;
- char * out = malloc(strlen(in) * 2 + 1);
+ char * out;
+
+ if ( in == NULL ) return NULL;
+
+ out = malloc(strlen(in) * 2 + 1);
bzero(out, strlen(in) * 2 + 1);
ret = out;
while(in[0])
@@ -509,134 +513,130 @@
}
static void
_cli_sql_dump_plugins(p)
- struct arglist * p;
+ struct nessus_plugin * p;
{
- if(p && p->next)
+ while (p != NULL )
{
- char * m;
- struct arglist *q = p->value;
- printf("INSERT INTO plugins VALUES ('%d', ", (int)arg_get_value(q, "ID"));
+ char * m, * n;
+ int n_sz;
+ printf("INSERT INTO plugins VALUES ('%d', ", p->id);


- m = arg_get_value(q, "NAME");
- m = sql_addslashes(m);
+ m = sql_addslashes(p->name);
printf("'%s', ", m);
efree(&m);

- m = arg_get_value(q, "FAMILY");
- m = sql_addslashes(m);
+ m = sql_addslashes(p->family);
printf("'%s', ", m);
efree(&m);


- m = arg_get_value(q, "CATEGORY");
- m = sql_addslashes(m);
+ m = sql_addslashes(p->category);
printf("'%s', ", m);
efree(&m);

- m = arg_get_value(q, "COPYRIGHT");
- m = sql_addslashes(m);
+ m = sql_addslashes(p->copyright);
printf("'%s', ", m);
efree(&m);

- m = arg_get_value(q, "SUMMARY");
- m = sql_addslashes(m);
+ m = sql_addslashes(p->summary);
printf("'%s', ", m);
efree(&m);

- m = arg_get_value(q, "DESCRIPTION");
- m = sql_addslashes(m);
+
+ n_sz = p->desc_len;
+ n = emalloc(n_sz);
+ uncompress((unsigned char*)n, &n_sz, p->zdescription, p->zdesc_len);
+ m = sql_addslashes(n);
printf("'%s',", m);
efree(&m);
+ efree(&n);

- m= arg_get_value(q, "VERSION");
- m = sql_addslashes(m);
+ m = sql_addslashes(p->version);
printf("'%s',", m);
efree(&m);


- m= arg_get_value(q, "CVE_ID");
- if( m != NULL )
+ if( p->cve != NULL )
{
- m = sql_addslashes(m);
+ m = sql_addslashes(p->cve );
printf("'%s',", m);
efree(&m);
}
else printf("'',");


- m = arg_get_value(q, "BUGTRAQ_ID");
- if(m != NULL)
+ if(p->bid != NULL)
{
- m = sql_addslashes(m);
+ m = sql_addslashes(p->bid );
printf("'%s',", m);
efree(&m);
}
else printf("'',");

- m = arg_get_value(q, "XREFS");
- if(m != NULL)
+ if(p->xrefs != NULL)
{
- m = sql_addslashes(m);
+ m = sql_addslashes(p->xrefs);
printf("'%s');\n", m);
efree(&m);
}
else printf("'');\n");
-
-
- _cli_sql_dump_plugins(p->next);
+ p = p->next;
}
}
static void
-_cli_dump_plugins(plugins)
- struct arglist * plugins;
+_cli_dump_plugins(p)
+ struct nessus_plugin * p;
{
- if(!plugins)
- return;
- while(plugins->next)
+ while( p != NULL )
{
- char * var = arg_get_value(plugins->value, "ASC_ID");
+ char * var = p->asc_id;
+ char * n;
+ int n_sz;
printf("%s|", var);
- var = addslashes(arg_get_value(plugins->value, "FAMILY"));
+ var = addslashes(p->family);
printf("%s|", var);
efree(&var);
- var = addslashes(arg_get_value(plugins->value, "NAME"));
+ var = addslashes(p->name);
printf("%s|", var);
efree(&var);
- var = addslashes(arg_get_value(plugins->value, "CATEGORY"));
+ var = addslashes(p->category);
printf("%s|", var);
efree(&var);
- var = addslashes(arg_get_value(plugins->value, "COPYRIGHT"));
+ var = addslashes(p->copyright);
printf("%s|", var);
efree(&var);


- var = addslashes(arg_get_value(plugins->value, "SUMMARY"));
+ var = addslashes(p->summary);
printf("%s|", var);
efree(&var);


- var = addslashes(arg_get_value(plugins->value, "VERSION"));
+ var = addslashes(p->version);
printf("%s|", var);
efree(&var);

- var = addslashes(arg_get_value(plugins->value, "CVE_ID"));
+ var = addslashes(p->cve);
printf("%s|", var);
efree(&var);

- var = addslashes(arg_get_value(plugins->value, "BUGTRAQ_ID"));
+ var = addslashes(p->bid);
printf("%s|", var);
efree(&var);

- var = addslashes(arg_get_value(plugins->value, "XREFS"));
+ var = addslashes(p->xrefs);
printf("%s|", var);
efree(&var);
-
- var = addslashes(arg_get_value(plugins->value, "DESCRIPTION"));
+
+ n_sz = p->desc_len;
+ n = emalloc(n_sz);
+ uncompress((unsigned char*)n, &n_sz, p->zdescription, p->zdesc_len);
+ var = addslashes(n);
printf("%s\n", var);
efree(&var);
-
- plugins = plugins->next;
+ efree(&n);
+ p = p->next;
}
}


_______________________________________________
Nessus-cvs mailing list
Nessus-cvs [at] list
http://mail.nessus.org/mailman/listinfo/nessus-cvs

Nessus commits RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.