Mailing List Archive

NessusClient/nessus attack.c,1.2,1.3
Update of /usr/local/cvs/NessusClient/nessus
In directory raccoon.nessus.org:/tmp/cvs-serv43307

Modified Files:
attack.c
Log Message:
fix a hard-to-reproduce segfault

Index: attack.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/attack.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- attack.c 11 Sep 2005 11:17:12 -0000 1.2
+++ attack.c 17 Aug 2006 15:17:49 -0000 1.3
@@ -74,9 +74,9 @@
* Set up the plugin list, according to the
* Nessus Transfer Protocol version 1.1
*/
- plug_list = emalloc(num_plug*50+1+num_scanners*50+1);
+ plug_list = emalloc(num_plug*20+1+num_scanners*20+1);
setup_plug_list(context->plugins, context->scanners, plug_list);
- if(!strlen(plug_list))
+ if( plug_list[0] == '\0' )
sprintf(plug_list, "0");

/* Add plugin_set to server preferences so it gets sent to the server */
@@ -141,9 +141,9 @@
* Set up the plugin list, according to the
* Nessus Transfer Protocol version 1.1
*/
- plug_list = emalloc(num_plug*50+1+num_scanners*50+1);
+ plug_list = emalloc(num_plug*20+1+num_scanners*20+1);
setup_plug_list(context->plugins, context->scanners, plug_list);
- if(!strlen(plug_list))
+ if( plug_list[0] == '\0' )
sprintf(plug_list, "0");

/* Add plugin_set to server preferences so it gets sent to the server */
@@ -219,9 +219,9 @@
{
if( w->enabled )
{
- snprintf(sp, sizeof(sp), "%d", w->id);
- strcat(plug_list, sp);
- strcat(plug_list, ";");
+ snprintf(sp, sizeof(sp), "%d;", w->id);
+ memcpy(plug_list, sp, strlen(sp) + 1);
+ plug_list += strlen(sp);
}
w = w->next;
}

_______________________________________________
Nessus-cvs mailing list
Nessus-cvs@list.nessus.org
http://mail.nessus.org/mailman/listinfo/nessus-cvs